Forum: Ruby on Rails NoMethodError and the select form helper

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2007-01-08 08:25
(Received via mailing list)
I am trying to create a listing of objects in a table with a drop down
box to edit one particular aspect of each thing in the list , but I can
not even get the form to render without getting a NoMethodError.
Currently I have something like this:

<% for thing in @things %>
  //...table stuff here...
    <td><%=h thing.element1 %></td>
    <td><%=h thing.element2 %></td>
    <td><%=h thing.element3 %></td>
      //...etc, etc, and then I have the following which give me a
NoMethodError...
    <td><%= select('thing', 'elementx', [ 'choice1', choice2'],
:selected => thing.elementx ) %>

<% end %>
</table>

Of course, once I fix this get the form to actually render, I still
haven't quite figured out how I would then update all instances of this
object with their (possibly new) values. I assume that I would just
have to iterate through @things and call update_attributes on each
element, but I'm not quite sure how to do that

Sorry if this is a bit of a stupid question, I'm a still learning.

Thanks,
Paul
This topic is locked and can not be replied to.