I\'m just about to pull my hair out... I\'ve been trying to enable CORS in this Rails app since the morning and it just doesn\'t work. I\'ve tried this, using Rack Cors Gem
You should use rack cors
It provides a nice DSL, to use in your config/application.rb
, instead of the messy header work and before filters.
A very permissive would be as follows, but of course, you'll have to tailor it a bit.
use Rack::Cors do
allow do
origins '*'
resource '*', headers: :any, methods: :any
end
end