title: Different layout for controller with respond_to in Rails
body: <p>I understand I can call the <code>render</code> method with <code>layout: 'my_layout'</code> to change the layout within a controller method. However, some of my controller methods have the following so that I can easily render JSON as well:</p>
  
  <pre><code>respond_to do |format|
    format.html
    format.json { render json: @cars }
  end
  </code></pre>
  
  <p>How do I change the layout for <code>format.html</code>? Should I replace <code>format.html</code> with <code>render layout: 'my_layout'</code>? Is there an option I can pass to <code>format.html</code>?</p>