Ember-CLI or ember-rails for and Ember app in a rails web app?

I see that the ember-cli community is very active. Also, I see that the ember-rails gem is still fairly active in terms of commits.

I was wondering, which one of the two is the recommended way of using EmberJS with Rails?

I started with ember-rails but felt as if the community was moving towards ember-cli so I switched. It still feels like the right decision so far.

1 Like

I see. I’m leaning towards the same direction.

However, it would be beneficial to know what the creators of Ember are suggesting.

Are Ember and ember-rails going to always be maintained independent of ember-cli. Is ember-cli going to just be a tool to help with rapid ember development, or is it going to eventually become the de-facto way of using EmberJS.

Amarish

ember-cli is already the de-facto standard and will continue to be for the foreseeable future. Using the ember-rails gem is a pretty big step backwards. You’ll miss out on modules, fast reloads, generators, a ready-to-go testing setup, and a whole lot more. You can read Tom Dale’s comments about it here: https://github.com/emberjs/rfcs/pull/15

If you’re doing a greenfield Ember app without any server rendered stuff I would recommend just creating an ember-cli app that is completely separate from Rails (you can keep them in the same repo if you want). You can symlink ember-cli’s output in /dist into your rails public folder while developing and build the files there when deploying.

You should also checkout the ember-cli-rails gem which provides a good setup and has configuration options set correctly for development and deployment with Rails:

https://github.com/rwz/ember-cli-rails

2 Likes

Also https://github.com/LevelbossMike/ember-deploy for another more loosely coupled way of deploying ember cli with rails.

2 Likes

I strongly advocate ember-cli for the frontend and rails as the API layer, separately. Having said that, if I don’t really need full rails, I look towards something more lightweight.

I am currently moving from ember-rails to ember-cli. it is kind of a bitch, but I think it is the right move.

We have a blog post up on our blog that will be a little helpful here, Ember CLI, Rails and Circle CI. It’s a higher level explanation of how to get Circle CI set up, but it links to a sample app on Github in the first paragraph that shows how we set up all of our Ember CLI and Rails projects. You can also see some more of our projects at https://github.com/greenfieldhq.

Our pattern is Ember CLI within a front end folder and rails in a backend folder within the same repo. We then proxy requests to Rails documented within ember server section at The Ember CLI - Introduction - Ember CLI Guides

2 Likes

Update on ember-deploy

This looks like it’s going to be getting some more attention. @lukemelia is doing a talk on this at the upcoming ember conference. EmberConf 2022 | Tuesday, April 15-19

Also there were two separate repos that just got merged into GitHub - ember-cli-deploy/ember-cli-deploy: A deployment pipeline for Ember CLI apps

1 Like