CORS Support

Enabling CORS is simple. You just set config.cors in the config/application.rb file. Here’s an example:

config/application.rb:

Jets.application.configure do
  # ...
  config.cors = true
end

A config.cors = true will add a response header with Access-Control-AllowOrigin='*'. If you would like more specificity then you can set the domain name like so:

Jets.application.configure do
  # ...
  config.cors = "*.mydomain.com"
end

The example above adds a response header with Access-Control-AllowOrigin='*.mydomain.com'.

Pro tip: Use the <- and -> arrow keys to move back and forward.

Edit this page

See a typo or an error? You can improve this page. This website is available on GitHub and contributions are encouraged and welcomed. We love pull requests from you!