Skip to content

Instantly share code, notes, and snippets.

@itzsaga
Created July 6, 2017 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itzsaga/22764bec4b09c07c1166c9471ca693b1 to your computer and use it in GitHub Desktop.
Save itzsaga/22764bec4b09c07c1166c9471ca693b1 to your computer and use it in GitHub Desktop.
# /config/initializers/cors.rb
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins 'localhost:3000'
resource '*',
headers: :any,
methods: [:get, :post, :put, :patch, :delete, :options, :head]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment