Render JSON with header
<p>I want to render JSON with the following <code>cors</code> header in my controller:</p>

<pre><code>'Access-Control-Allow-Origin' = '*'.
</code></pre>

<p>I tried this:</p>

<pre><code>def my_action
  render(json: some_params)
  response.headers['Access-Control-Allow-Origin'] = '*'
end
</code></pre>

<p>but I got an <code>AbstractController::DoubleRenderError</code>. Are there ways to render JSON with headers?</p>