title: How does Rails yield to multiple block in the erb templates?
body: <p>How does rails get away with the following in an .erb file?</p>
  
  <pre><code>&lt;%= yield :sidebar %&gt;
  &lt;%= yield :other_bar %&gt;
  &lt;%= yield :footer %&gt;
  </code></pre>
  
  <p>How are they able to yield multiple times in the same context to different symbols? Is this some kind of rails magic?</p>
  
  <p>I'm totally familiar with: </p>
  
  <pre><code>def some_method(arg1, arg2, &amp;block)
   yield(:block)
  end
  </code></pre>
  
  <p>To my knowledge following doesn't work:</p>
  
  <pre><code>def some_incorrect_method(arg1, &amp;block1, &amp;block2)
   yield(:block1)
   yield(:block2)
  end
  </code></pre>
  
  <p>So how are they doing it? How do they make it work?</p>