I have a form with multiple drop down select fields. All is working
while entering data. However, when editing the displayed value is the
default used for a new record. I need it to display the value stored in
the database, while still allowing the user to change the value from the
drop down list if it was wrong. The select tables are setup in a helper
file.
<%= f.label :Salutation %><%= f.select :salutation,
options_for_select(salutations, :selected => “Ms.”) %>
<%= f.label :Suffix %><%= f.select :suffix,
options_for_select(suffixes) %>
I have read many other similar posts, but I still do not see how to fix
it. This is my first RoR app so a solid example would be nice. Do I
need a second form for doing edits from data entry? If so how do I
change the options in the select statements?