Passing a collection to a form partial


#1

I’m trying to create an editable table by rendering a partial containing
a form.

In the index:

<%= render :partial => 'product_edit', :collection => @products %>

In the partial:

<% form_for :product do |f| %>

<%= f.text_field :name %> <%= f.select :in_stock, [['YES','true'],['NO','false']] %> <% end %>

I’m getting an error ‘undefined local variable or method product…’

What am I doing wrong?


#2

On Mon, Dec 29, 2008 at 2:37 PM, sa 125
removed_email_address@domain.invalid wrote:

I’m trying to create an editable table by rendering a partial containing
a form.

In the index:

<%= render :partial => 'product_edit', :collection => @products %>

I’m getting an error ‘undefined local variable or method product…’

The name of the local variable is the name of the partial, which is
product_edit
in this case.


#3

right… thanks.