title: switch layout columns based on controller
body: <p>so basically my application looks like this</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      ...
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="content"&gt;
      &lt;div id="content_left"&gt;
          // Some Stuff
      &lt;/div&gt;
  
      &lt;div id="content_right"&gt;
          &lt;%= yield %&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>now i want to switch between a two column layout and a single column layout based on the controller (at best: also based on the method i'm using).</p>
  
  <p>between the body and the content and also in there head there is way too much stuff for simply creating a second layout and adding this as a <code>layout</code>call in my controller without too much code duplication.</p>
  
  <p>what i would love to do is something like this:</p>
  
  <p>all should use this</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      ...
  &lt;/head&gt;
  &lt;body&gt;
   // much stuff
   &lt;%= yield %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and now i can switch between two layouts, f.e</p>
  
  <p>single_col</p>
  
  <pre><code>&lt;div id="content"&gt;
      &lt;%= yield %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>or two_column</p>
  
  <pre><code>&lt;div id="content"&gt;
      &lt;div id="content_left"&gt;
          // Some Stuff
      &lt;/div&gt;
  
      &lt;div id="content_right"&gt;
          &lt;%= yield %&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and then in the last yield there should be the view that is related to my controller and method.</p>
  
  <p>is there an easy way to achieve this?</p>
  
  <p>thanks for all hints.</p>
  
  <p>PLEASE leave a comment if something is unclear. </p>