What javascript framework would you use to build a multi-page Rails app?

55 views
Skip to first unread message

learning_to_swim

unread,
Jun 18, 2014, 5:23:17 PM6/18/14
to rubyonra...@googlegroups.com
I am building a multi-page rails web app and am struggling with finding a good JavaScript framework to use. I could use jQuery for all the low-level DOM manipulations but would like to benefit from the structure of a good framework.

I am new to Rails/JavaScript and most of what I have seen (Backbone/Ember/Angular) are really designed for Single Page Applications and you will have to hack your way in to build a multi page web app (or at least that is what I infer). I am looking for something that just works out of the box without too much tinkering.

Any pointers are appreciated.

Sampath Weerasinghe

unread,
Jun 19, 2014, 3:48:50 AM6/19/14
to rubyonra...@googlegroups.com

Try ext.js! it looks awesome


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e674a4cb-2dc6-4d39-8c01-e04859d576be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Fleetwood-Boldt

unread,
Jun 19, 2014, 12:15:21 PM6/19/14
to rubyonra...@googlegroups.com

The term "single page app" is a misnomer in my opinion, because as you use "single page app" you see many pages. "Single page" just means it loads once in a single web server call, and then all subsequent interactions manipulate parts of the DOM and talk to an API on the back -end without reloading the page. 


You don't have to "hack your way" to build an app that you can click from page-to-page, you just have to know how to use the framework correctly.

If you use Backbone, check out http://marionettejs.com alongside it.

Angular and Ember are both relatively new (< 2 years old), and AFAIK there's a lot of active development going on. If you want to be on the bleeding edge and don't mind a steep learning curve, they are both worth learning. 

If you perhaps don't want to be on the bleeding edge and want to stick with Rails, perhaps now isn't the right time to learn Ember or Angular.

Backbone, while very powerful, requires more coding and without Marionette you have to wire up a lot of UI updates manually (Ember and Angular take a more declarative approach and you have to do less manual UI updating). Marionette eliminates some of that, but you still have a lot of code to write and test. 

I would classify all three as for experienced Javascript developers and wouldn't recommend any of them unless you had a solid foundation in the nuances and inner working of advanced Javascript (like scoping, event bubbling, and promises). 

Max

unread,
Jun 20, 2014, 8:57:08 AM6/20/14
to rubyonra...@googlegroups.com
I wrote this blog entry a while ago and it needs some work and fine tuning.  

http://maxwellhoffmanfamily.com/wordpress/?p=73

that being said, it walks someone through a pattern for using angularjs in a rails app.  It isn't using the angular router, but it does give you the ability to easily leverage some of the great features of angular in a rails application.  

We have been using angularjs in rails apps for a couple years now and like it a lot.  I hear a lot of great things about ember, when we chose it was a coin flip.  I don't have experience with ember so i can't compare personally but angular works great for us.

HTH

max

Don

unread,
Jun 21, 2014, 12:45:47 PM6/21/14
to rubyonra...@googlegroups.com
I'm working my way through this rails-ember tutorial which you might find helpful:


I was really confused in Ember tutorials early on until I understood the difference in meanings of certain similar "terms"  used by both Ember and Rails.  This helps:


Also this is a good comparison on the differences between Ember and Angular, so you can choose which might fit your needs better.


Hope these are useful.

Ganesh Ranganathan

unread,
Jun 21, 2014, 2:18:20 PM6/21/14
to rubyonra...@googlegroups.com

On Thu, Jun 19, 2014 at 2:53 AM, learning_to_swim <ash...@gmail.com> wrote:
I am new to Rails/JavaScript and most of what I have seen (Backbone/Ember/Angular) are really designed for Single Page Applications and you will have to hack your way in to build a multi page web app (or at least that is what I infer). I am looking for something that just works out of the box without too much tinkering.

​Angular frontend + Rails API get works best IMO. Am working on a couple of sites using this stack and the UI dev swears by Angular.

Thanks,
Ganesh​

Reply all
Reply to author
Forward
0 new messages