Forum: Ruby on Rails What javascript framework would you use to build a multi-page Rails app?

2ffc2bc1b4cb95c53cddd75d5d7effb8?d=identicon&s=25 learning_to_swim (Guest)
on 2014-06-19 08:01
(Received via mailing list)
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.
333d7a4cd8ba2fbbf31cd01a208afb7b?d=identicon&s=25 Sampath Weerasinghe (Guest)
on 2014-06-19 09:49
(Received via mailing list)
Try ext.js! it looks awesome
Dfc7587fd73f2efa19d6f1f9611b70ba?d=identicon&s=25 Jason Fb (jasonfb)
on 2014-06-19 18:15
(Received via mailing list)
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).
D8fd374e9e1811e5b5b8f37b667916bd?d=identicon&s=25 Max Maxwell (aamax)
on 2014-06-20 14:58
(Received via mailing list)
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
B7d672c2576be4ee63eb90d8726957d2?d=identicon&s=25 Don (Guest)
on 2014-06-21 18:47
(Received via mailing list)
I'm working my way through this rails-ember tutorial which you might
find
helpful:

    http://ember.vicramon.com/

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:


 http://robots.thoughtbot.com/shared-terminology-ye...

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

    http://www.benlesh.com/2014/04/embular-part-1-comp...

Hope these are useful.
61b2cb27fe3d25f42ecc0364c33420f8?d=identicon&s=25 Ganesh Ranganathan (Guest)
on 2014-06-21 20:19
(Received via mailing list)
On Thu, Jun 19, 2014 at 2:53 AM, learning_to_swim <ashokts@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​
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.