Skip to content

Instantly share code, notes, and snippets.

@jdaviderb
Created January 26, 2014 05:01
Show Gist options
  • Save jdaviderb/8628641 to your computer and use it in GitHub Desktop.
Save jdaviderb/8628641 to your computer and use it in GitHub Desktop.
Disable Cross Rails 4
step 1
Install rack-cors
into Gemfile define
gem 'rack-cors', :require => 'rack/cors'
Step 2
into Config.ru add the following lines
require 'rack/cors'
use Rack::Cors do
# allow all origins in development
allow do
origins '*'
resource '*',
:headers => :any,
:methods => [:get, :post, :delete, :put, :options]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment