clarion/app/controllers/concerns/public_api_exposing.rb

16 lines
298 B
Ruby
Raw Permalink Normal View History

2019-04-28 21:10:54 +03:00
require "active_support/concern"
module PublicApiExposing
extend ActiveSupport::Concern
def set_access_control_headers
if request.format.json?
2019-04-28 21:10:54 +03:00
response.headers["Access-Control-Allow-Origin"] = "*"
end
end
2019-04-28 21:10:54 +03:00
included do
before_action :set_access_control_headers
end
end