mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
- Storybook need to access through a GET method on `/rails/stories/**` served by `ViewComponent::Storybook::StoriesController` - Configure exact policy with an initialized filter
15 lines
430 B
Ruby
15 lines
430 B
Ruby
# Adjust headers to allow running Storybook in development.
|
|
# Uses iframes and doesn't play nicely with CORS checks
|
|
|
|
if Rails.env.development?
|
|
module PermissiveCORSHeaders
|
|
def self.before(response)
|
|
response.headers["Access-Control-Allow-Origin"] = "*"
|
|
response.headers["Access-Control-Allow-Methods"] = "GET"
|
|
end
|
|
end
|
|
|
|
ViewComponent::Storybook::StoriesController.before_action(PermissiveCORSHeaders)
|
|
end
|
|
|