title: Rendering partials from a helper method
body: <p>Is it possible to render a partial using a helper method where you can also pass local variables from the view in which the helper method is called?  For example, when I include this code directly in the view, it renders the partial properly: </p>
  
  <pre><code> &lt;%= render :partial =&gt; "add_round", :locals =&gt; { :f =&gt; f } %&gt;
  </code></pre>
  
  <p>Then I moved it to a helper method: </p>
  
  <pre><code>def addRound
    render :partial =&gt; "add_round", :locals =&gt; { :f =&gt; f }
  end
  </code></pre>
  
  <p>Then I called it from the view again with: </p>
  
  <pre><code> &lt;%= addRound %&gt;
  </code></pre>
  
  <p>This did not work with the :locals => { :f => f } included in the code.  It returned this error: undefined local variable or method `f'.  However, the addRound method did render something with the following:</p>
  
  <pre><code>def addRound
    render :partial =&gt; "add_round"
  end
  </code></pre>
  
  <p>Writing it this way allowed me to render partials that didn't require the local variables to be passed through (such as plain text strings).  But how can I get it to work with the :locals => { :f => f } included?  Is there another way to write that?</p>
  
  <p>Thanks so much. </p>