clarion/app/controllers/api/application_controller.rb
Vencislav Atanasov b732aff523 Add CORS header in order to access the public API from JavaScript
(I have no idea what I'm doing)
2016-11-04 15:34:44 +02:00

8 lines
198 B
Ruby

class Api::ApplicationController < ::ApplicationController
def set_access_control_headers
if request.format.json?
response.headers['Access-Control-Allow-Origin'] = '*'
end
end
end