Move method to a more appropriate place
This commit is contained in:
parent
b732aff523
commit
b5192a89a9
|
@ -1,7 +1,2 @@
|
||||||
class Api::ApplicationController < ::ApplicationController
|
class Api::ApplicationController < ::ApplicationController
|
||||||
def set_access_control_headers
|
|
||||||
if request.format.json?
|
|
||||||
response.headers['Access-Control-Allow-Origin'] = '*'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,6 +3,12 @@ require 'active_support/concern'
|
||||||
module PublicApiExposing
|
module PublicApiExposing
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
def set_access_control_headers
|
||||||
|
if request.format.json?
|
||||||
|
response.headers['Access-Control-Allow-Origin'] = '*'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
included do
|
included do
|
||||||
before_action :set_access_control_headers
|
before_action :set_access_control_headers
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue