I want to render JSON with the following cors
header in my controller:
'Access-Control-Allow-Origin' = '*'.
I tried this:
def my_action
render(json: some_params)
response.headers['Access-Control-Allow-Origin'] = '*'
end
but I got an AbstractController::DoubleRenderError
. Are there ways to render JSON with headers?