Hi, I have a question about the collection_select helper and how it saves using the update_attributes command. If I have a form_for using a model instance such as @person and have elements inside it like:
<%= f.text_field :lastName %> and then want to include a selection drop down that has zip codes that are sourced from another table such as: <%= collection_select @person, :zipCode, @allZipCodes, :zipCode, :zipCode %> when I use the controller to update these fields using the command: @person = People.find(params[:id]) @person.update_attributes(params[:person]) how do I get the collection_select to save its value automatically? If I do the above example, lastName is saved but what is selected in the drop-down is not. Am I using the wrong syntax? I haven't been able to get f.collection_select to work, so I'm not sure where to go from here (besides setting that attribute manually -- hopefully not!!!). If you could help I'd definitely appreciate it. Thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

