Use Gem Ember Rails or run Ember separately


Hi, I want to develop a Rails application with Ember, this is my first approach with this JS Framework. My question is if is better to use the ember gem for rails or run ember separately form the main application? If I use Gem Ember the advantage?


Well, that depends. Both have pros and cons, and it’s hard to make a decision as per your description. But if it’s a brand new project and if you think Ember can handle all the application state, separation of concerns would generally be a better choice. FYI, here is a post from thoughtbot: migrating from ember-rails to ember-cli.


From personal experience, I can tell you that having them separate is better. It can scale better, build times are shorter, easier to work with, and you can host them separately.

I feel like the last point is a big one because now my node app only has to act like an api and doesn’t have to worry about serving assets.


Yes but in this why i can with only command generate class,model ecc…for ember and rails in only one pass…And i think maybe is better for the model level


This is very app specific, but broadly speaking, I think separating your Rails and Ember concerns will be valuable regardless. Rails serves as your API and Ember on the client side. Here is another discussion about this.