README.md in ember-cli-rails-0.1.2 vs README.md in ember-cli-rails-0.1.3

- old
+ new

@@ -81,11 +81,11 @@ end ``` ## Usage -You render your Ember CLI app by including the corresponding JS/CSS tags in whichever +You render your EmberCLI app by including the corresponding JS/CSS tags in whichever Rails view you'd like the Ember app to appear. For example, if you had the following Rails app ```rb @@ -121,29 +121,82 @@ init` and then add the following to your `Guardfile`. ```ruby guard "livereload" do # ... - watch %r{app/<your-appname>/\w+/.+\.(js|hbs|html|css|<other-extensions>)} + watch %r{app/<your-appname>/app/\w+/.+\.(js|hbs|html|css|<other-extensions>)} # ... end ``` This tells Guard to watch your EmberCLI app for any changes to the JavaScript, -Handlebars, HTML, or CSS files. Take note that other extensions can be added to -the line (such as `coffee` for CoffeeScript) to watch them for changes as well. +Handlebars, HTML, or CSS files within `app` path. Take note that other +extensions can be added to the line (such as `coffee` for CoffeeScript) to +watch them for changes as well. +## Heroku + +In order to deploy EmberCLI Rails app to Heroku you need to follow the steps +below: + +First, enable Heroku Multi Buildpack by running the following command: + +```sh +heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi +``` + +Next, check in `.buildpacks` file to specify which buildpacks to use: + +``` +https://github.com/heroku/heroku-buildpack-nodejs +https://github.com/heroku/heroku-buildpack-ruby +``` + +Add `rails_12factor` gem to your production group in Gemfile, then run `bundle +install`: + +```ruby +gem "rails_12factor", group: :production +``` + +Add a `package.json` to the root of your Rails project. This is to make sure +it'll be detected by the NodeJS buildpack. + +```javascript +{ + "dependencies": { + "bower": "*" + } +} +``` + +Add a `postinstall` task to your EmberCLI app's `package.json`. This will +ensure that during the deployment process, Heroku will install all dependencies +found in both `node_modules` and `bower_components`. + +```javascript +{ + # ... + "scripts": { + # ... + "postinstall": "../../node_modules/bower/bin/bower install" + } +} +``` + +Now you should be ready to deploy. + ## Additional Information -When running in the development environment, EmberCLI Rails runs `ember build` -with the `--output-path` and `--watch` flags on. The `--watch` flag tells -EmberCLI to watch for file system events and rebuild when an EmberCLI file is changed. -The `--output-path` flag specifies where the distribution files will be put. -EmberCLI Rails does some fancy stuff to get it into your asset path without -polluting your git history. Note that for this to work, you must have +When running in the development environment, EmberCLI Rails runs `ember build` +with the `--output-path` and `--watch` flags on. The `--watch` flag tells +EmberCLI to watch for file system events and rebuild when an EmberCLI file is +changed. The `--output-path` flag specifies where the distribution files will +be put. EmberCLI Rails does some fancy stuff to get it into your asset path +without polluting your git history. Note that for this to work, you must have `config.consider_all_requests_local = true` set in `config/environments/development.rb`, otherwise the middleware responsible for -building Ember CLI will not be enabled. +building EmberCLI will not be enabled. Alternatively, if you want to override the default behavior in any given Rails environment, you can manually set the `config.use_ember_middleware` and `config.use_ember_live_recompilation` flags in the environment-specific config file.