Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Handle CORS with Rails
# application_controller.rb
before_filter :handle_cors
def handle_cors
if env.keys.include? "HTTP_ORIGIN"
response.headers['Access-Control-Allow-Origin'] = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.