Skip to content

Instantly share code, notes, and snippets.

@andikan
Forked from mscoutermarsh/application.rb
Created October 24, 2013 18:23
Show Gist options
  • Select an option

  • Save andikan/7142427 to your computer and use it in GitHub Desktop.

Select an option

Save andikan/7142427 to your computer and use it in GitHub Desktop.
# Add this to your application.rb
config.middleware.use Rack::Cors do
allow do
origins '*'
# location of your API
resource '/api/*', :headers => :any, :methods => [:get, :post, :options, :put]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment