Skip to content

knomedia/ember-cli-rails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ember-cli-rails

A rails template and build script for working with ember-cli and deploying with a rails api / backend. The goal is to allow ember-cli to be in charge of building and testing your ember app, and rails to be in charge of building and testing your rails app.

Dependencies

You will need the usual dev setup ruby, rails, bundler, node && npm. Once you have those, you will also need bower and ember-cli

install bower via npm

$ npm install -g bower

install ember-cli via npm

$ npm install -g ember-cli

Usage

clone the repo

$ git clone git@github.com:knomedia/ember-cli-rails.git

Assuming you are in the same directory as the ember-cli-rails repo, create a new rails app like:

$ rails new app -m ember-cli-rails/template.rb

If you are in another location, change the path to the template file as needed.

You now have a rails project with an ember-cli project within it.

The template will set a catch-all rails route that serves up the ember app. You'll need to update your ember app config to set location: 'hash' manually for this to work. As you add api endpoints to rails be sure to place them before the catch all route.

Daily development

To work on the project, cd into the project root and:

$ bin/rails s

In another tab cd into your ember app (it'll be inside the rails root and labled with your app-name-ember). From within the ember-app directory run the development ember server

$ ember serve --proxy http://localhost:3000

This will proxy api calls to your rails backend. For more information see the ember-cli docs

Deployment

From time to time, or whenever time to deploy, cd to your rails root and run:

$ ./bin/build.sh

This will utilize ember-cli to build your ember app, and copy files over to your rails public/ directory.

About

template and build script for using ember-cli and rails together

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published