“ undefined method `enumerable_enumerator_path' " error.

I'm using basic scaffold structure. What I need, is to add 'moderate' action and view by changing published to true. In my idea, on moderate.html I should get the list of all unpublished entries with the ability to change and save their parameters. Here are parts of my code:

#names_controller.rb def moderate @name = Name.find(:all, :conditions => {:published => false} )    respond_to do |format|       format.html       format.xml      end end

#moderate.html.erb <% form_for @name.each do |f| %>   <%= f.error_messages %>     <%= f.text_field :which %>     <%= f.text_field :what %>     <%= f.check_box :published %>     <%= f.submit %>   </p> <% end %> Instead I'm getting this error:

NoMethodError in Names#moderate

Showing app/views/names/moderate.html.erb where line #1 raised:

undefined method `enumerable_enumerator_path' for #<ActionView::Base:0x1042c3e90> Extracted source (around line #1) So, can you help to newbie please?

ruby 1.8.7 (2009-06-12 patchlevel 174)

[universal-darwin10.0] Rails 2.3.5

I'm steel looking for an answer or suggestion.

You don't want that each there - that's asking form_for to display a form for the enumerator object this returns which is not what you want. Assuming you want a form for each of the objects in that array you want something more like

<% @name.each do |name| %>   #do something with name here <% end %>

or render a partial for each name object.

Fred