pwicks-ws/OPfWkKRs@public.gmane.org
2007-Jan-08 06:24 UTC
NoMethodError and the select form helper
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---