Passing a collection to a form partial

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?

On Mon, Dec 29, 2008 at 2:37 PM, sa 125
[email protected] 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.

right… thanks.