Skip to content

Instantly share code, notes, and snippets.

@seifsallam
Last active December 18, 2015 14:39
Show Gist options
  • Save seifsallam/5798524 to your computer and use it in GitHub Desktop.
Save seifsallam/5798524 to your computer and use it in GitHub Desktop.
If you were using ember-rails and want to move it out to its own app. Here are the steps using Yeoman
config.middleware.use Rack::Cors do
allow do
origins '*'
resource '*', :headers => :any, :methods => [:get, :post, :options]
end
end

Using Yo Ember instead of Ember-Rails

First Generate Ember application using Yo Ember generator

  1. Install yeoman npm install -g yo grunt-cli bower
  2. Install ember-generator npm install -g generator-ember
  3. Create your project mkdir webapp && cd webapp
  4. Generate ember template yo ember
  5. Run itgrunt server

Copy your files manually from rails to the matching directories.

Finally, moving out of rails, you will need to enable cross-domain access in Rails. And to do this just add this Rack Cors Gem.

  1. Add this gem 'rack-cors', require: 'rack/cors' to your gemfile.
  2. Set it up by adding the following code to your config/application.rb

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment