The following options allow us to deploy Ember with Rails while still retaining the use of ember-cli for Ember development.
This method relies on Redis (or some other key/value store) as the integration point between Ember and Rails. When the Ember application is deployed, app assets (JS, CSS, images, etc) are uploaded straight to an asset host like S3/CloudFront. The bootstrapping markup for the Ember app is inserted into the key/value store and then is retrieved from there to be served up by Rails.
- Allows the front-end Ember app to be developed and deployed independently from the Rails app
- Since multiple versions of the Ember app can be stored in the key/value store, it is possible to test a particular version before enabling for all users
- Allows for Ember apps to be inserted anywhere within the Rails app while still being developed with ember-cli
- Ember and Rails apps can exist in separate git repositories
- Has the most moving parts and setup of the three options presented here
- Ember apps must be launched separately in development
Ember apps can be deployed entirely on their own as a distinct separate entity from the Rails app. This approach requires both static asset and site hosting (for the bootstrap markup). The Ember app would be referenced by a different subdomain than the Rails app and use the Rails app purely as an API.
- Allows the front-end Ember app to be developed and deployed independently from the Rails app
- Simplest approach to deploying a self-contained Ember application with fewest moving parts
- Ember and Rails apps can exist in separate git repositories
- Multiple subdomains for multiple apps
- Limited integration within Rails contexts (assumes Rails is being used purely as a backing API)
- Ember apps must be launched separately in development
The ember-cli-rails approach keeps the ember-cli app development within the context of the Rails repository. The Ember app uses ember-cli within a root-level directory of the Rails repository and integrates into the Rails asset pipeline.
- Combined Rails and Ember repositories and development workflow
- Allows for multiple Ember apps to exist within the Rails repository
- End-to-end integration testing with tools like Cucumber "just works"
- Assumes every developer needs both the Rails and Ember apps at all times
- Conflates the Rails and Ember apps into one project and repository
- Rails and Ember projects are versioned and deployed together
- Build and deploy times with the asset pipeline are much longer than using ember-cli alone