No commit activity in last 3 years
No release in over 3 years
Allows for the serving of multiple Ember apps within one Rails app. The Ember apps index.html is loaded from Redis via ember-cli-rails-deploy-redis in production.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 10.0
>= 0

Runtime

 Project Readme

ember-cli-rails-routes

Installation

Add this to your Gemfile and bundle install

gem 'ember-cli-rails-routes'

Setup

Rails App

In your routes.rb file:

ember_app :foo, scope: :app, path: 'frontend'

This reflects an ember app in the <RAILS_ROOT>/frontend directory that is exposed as /app/foo in the URL.

Ember App

First, you need to tell Ember to prepend the apps directory so Rails can serve assets from the right Ember app.

Here frontend/ is the same as path from above.

// ember-cli-build.js
var app = new EmberApp(defaults, {
  fingerprint: {
    enabled: true,
    prepend: 'frontend/'
  }
});

Second, tell Ember to treat the app route as the main entry point of the Ember app.

// app/router.js
Router.map(function() {
  this.route('frontend', { path: '/app/foo' }, function() {

  });
});

Alternativly use th ember-cli-rails-routes addon

Notice that using the fingerprint option causes the assets to be fingerprinted even in development, which increases build times. You can get just the prepend behavior and only in development by using the ember-cli-rails-routes addon.

$ ember install ember-cli-rails-routes
$ RAILS_PREPEND=frontend/ ember build

Running tests

  • cd into ember app (test/dummy/frontend)
    • ember build
  • cd into dummy rails app (test/dummy)
    • cucumber