title: Render a .js controller request as html
body: <p>I have a <code>before_filter</code> in my Rails app that sends users to <code>login_url</code> if they are logged out when they submit a request (in either html or js format).</p>
  
  <p>I would like my <code>format.js</code> to produce an identical result to <code>format.html</code>, in the following case to render the view with the 'notice' layout. How can I do this?</p>
  
  <pre><code>respond_to do |format|
    format.js
    format.html{ render :layout =&gt; "notice" }
  end
  </code></pre>