Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Rails Duck
Rails Duck
8,545 Points

Ruby on Rails + Node.js + Angular.js + Express.js + MongoDB = Ultimate Web App?

First of all, the category should be Ruby and JavaScript, but since that isn't a category on the category list thingy, I just put this post on General Discussion.

So, I'm learning Node.js, Angular.js, Express.js, and some other stuff in the Full Stack JavaScript track. Previously, I have been a Rails enthusiast and have created some very, very basic applications in it, but I haven't gone into depth with it. So, I had a thought that if I start the Ruby and Rails (haha, I meant the ruby track and rails track) tracks, would there be a way I can add Node.js and Express.js and Angular.js and MongoDB (or some other NoSQL database) to my Rails application to create a 'better' web app?

Here is the stuff I know: Node.js and Ruby on Rails are actually uncomparable since they both don't do the same things. Node.js isn't a framework. Express.js and Ruby on Rails are comparable, though. Second of all, I know that Node.js is much faster than Ruby on Rails and it is possible to add Real-Time to a Ruby on Rails application using Node.js.

I haven't actually started any Node.js or Express.js or any of that stuff. I'm still on jQuery Basics in my Full Stack JavaScript track, so I don't know if I'm talking correctly about what I'm talking.

So pretty much, I want a really simple guide on how to add all the stuff in JavaScript I'm about to learn into my Ruby on Rails applications. If that isn't possible, then I want to know if Full Stack JavaScript is a better way to head rather than Ruby on Rails or vice-versa.

Thanks in advance!

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

I'm not going to say it's impossible, but you have two competing ideas here, Ruby on Rails, and what is essentially a MEAN application. It would be fair to compare Rails vs MEAN stack, and with one, the other isn't needed. Also, I don't think Activerecord supports document based nosql databases. There probably are gems out there to help with this, but you're stepping outside of what is native to, and a core part of Rails.

You can easily add a lot of front-end javascript technologies into Rails, it works quite well. But Node and packages like Express are server side Javascript.

Rails 5 is bringing support for real-time updates via websockets, so that's worth looking at. I'm like Rails, but I'm turning into a bigger and bigger fan of Node.

If you want a rails like framework that runs on Node, check out http://meteor.com. That's what I'm learning.

Rails Duck
Rails Duck
8,545 Points

I've looked at Meteor... but I don't find it appealing to my needs. So what you're saying is that Rails doesn't really need Node.js or anything like that? Ok, I'll look into it by myself. Thanks! :D

Kevin Korte
Kevin Korte
28,149 Points

No, but you can use web sockets to make some data in Rails more Node like. I'm surprised you didn't like meteor, it's pretty well featured like rails, less restrictive, built on node.js, and runs off of npm, real time data works out of the box, no extra configuring on you end. But each is own, we all have our preferences, and that's a-ok!