Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save boy-jer/5845348 to your computer and use it in GitHub Desktop.
Save boy-jer/5845348 to your computer and use it in GitHub Desktop.
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