How do use the SPA concept in Rails


#1

Hi, I was watching Codeschool videos, the examples show how to do an SPA - i.e. 4 to 5 views in index.html

I’ve ported an ecommerce app to Rails that has a lot of sub folders, each being a mini application. i.e.

/orders - shows orders list and a drill down to see an order details.
/customers - customers list and a drill down to see customer details.

I couldn’t really put all the template views for such an app in one file. So would the key to using Ember in Rails say for an ecommerce app be to do multiple ember apps in different parts of the rails app? i.e.

/orders - part rails, part ember SPA for the 2 views (orders list and order details)
/customers - part rails and part ember SPA for 2 views (customer list and customer detail)

SPA seems to me every view template in 1 file. This would be a mangement headache if I had a 100 views. So am wondering what is the best way to split up the use of Ember within a Rails app with lots of moving parts in different folder sections? In the browser my layout is as follows:

/cart
/cart/billing
/cart/shipping
etc

Seems to me the way to pull this off is lot of little Ember SPA’s all over the app, 1 in each of the above folders. Please correct me if I’m off target and there’s a more enlightened way to do this for implementation and management.


#2

1 ember app, every noun is a resource, every verb is a route (detail and list are verbs). What is this every route is a mini app thing? When did Rails break REST? Plus, you’re essentially throwing away the router if you structure your app that way.

ember-app-kit rails is an awesome tool to get started with rails/ember though.


#3

Terminology issue. I look upon Clients - index, new, show, edit, destroy as a stand alone mini app coz of how I used to structure in another lang. Yes they’re all rest actions.

I tried ember-app-kit earlier this evening - that seems to have answered the question of how to divide up the moving parts of ember in rails.