title: Rails render partial with block
body: <p>I'm trying to re-use an html component that i've written that provides panel styling.  Something like:</p>
  
  <pre><code>  &lt;div class="v-panel"&gt;
      &lt;div class="v-panel-tr"&gt;&lt;/div&gt;
      &lt;h3&gt;Some Title&lt;/h3&gt;
      &lt;div class="v-panel-c"&gt;
        .. content goes here
      &lt;/div&gt;
      &lt;div class="v-panel-b"&gt;&lt;div class="v-panel-br"&gt;&lt;/div&gt;&lt;div class="v-panel-bl"&gt;&lt;/div&gt;&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>So I see that render takes a block.  I figured then I could do something like this:</p>
  
  <pre><code># /shared/_panel.html.erb
  &lt;div class="v-panel"&gt;
    &lt;div class="v-panel-tr"&gt;&lt;/div&gt;
    &lt;h3&gt;&lt;%= title %&gt;&lt;/h3&gt;
    &lt;div class="v-panel-c"&gt;
      &lt;%= yield %&gt;
    &lt;/div&gt;
    &lt;div class="v-panel-b"&gt;&lt;div class="v-panel-br"&gt;&lt;/div&gt;&lt;div class="v-panel-bl"&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And I want to do something like:</p>
  
  <pre><code>#some html view
  &lt;%= render :partial =&gt; '/shared/panel', :locals =&gt;{:title =&gt; "Some Title"} do %&gt;
    &lt;p&gt;Here is some content to be rendered inside the panel&lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Unfortunately this doesn't work with this error:</p>
  
  <pre><code>ActionView::TemplateError (/Users/bradrobertson/Repos/VeloUltralite/source/trunk/app/views/sessions/new.html.erb:1: , unexpected tRPAREN
  
  old_output_buffer = output_buffer;;@output_buffer = '';  __in_erb_template=true ; @output_buffer.concat(( render :partial =&gt; '/shared/panel', :locals =&gt; {:title =&gt; "Welcome"} do ).to_s)
  on line #1 of app/views/sessions/new.html.erb:
  1: &lt;%= render :partial =&gt; '/shared/panel', :locals =&gt; {:title =&gt; "Welcome"} do -%&gt;
  ...
  </code></pre>
  
  <p>So it doesn't like the <code>=</code> obviously with a block, but if I remove it, then it just doesn't output anything.</p>
  
  <p>Does anyone know how to do what I'm trying to achieve here?  I'd like to re-use this panel html in many places on my site.</p>