<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Blah Blah Woof Woof comments on Rails form helpers should not require an instance variable</title>
    <link>http://vault.openmonkey.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Blah Blah Woof Woof comments</description>
    <item>
      <title>"Rails form helpers should not require an instance variable" by triley</title>
      <description>&lt;p&gt;From &lt;a href="http://dev.rubyonrails.org/ticket/2726"&gt;ticket #2726&lt;/a&gt; in the Rails Trac:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;The form helpers assume the object you want them to reference is an instance variable, ie: they require an &amp;#8217;@&amp;#8217;. This makes them completely useless in a partial unless I explicitly include something like &amp;#8221;@user = user&amp;#8221; at the top of each partial.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;I came across this limitation today when I was using partials to contain forms to edit a collection of objects.&lt;/p&gt;


	&lt;p&gt;Right now the only way I can see to work around this is to add that additional line at the top of the partials in question.  Seems that the form helpers were really only designed to work best in the view that receives instance variables directly from the controller.&lt;/p&gt;

</description>
      <pubDate>Fri,  4 May 2007 00:24:00 PDT</pubDate>
      <guid>&lt;a href="/articles/2007/05/04/rails-form-helpers-should-not-require-an-instance-variable"&gt;Rails form helpers should not require an instance variable&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2007/05/04/rails-form-helpers-should-not-require-an-instance-variable"&gt;Rails form helpers should not require an instance variable&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
