How do I set the default value in an html select box generated using the select() helper in rails?
I've tried this (as the docs would indicate I do) but it doesn't work:
<%= select(:contact_number, :ph_type, PH_TYPE_OPT_FOR_SELECT, {}, {:selected => "Work"}) %><% text_field :contact_number, :number %>
People succeed in answering Adam Thorsen's questions 47% of the time (24 successes in 51 attempts).
Answers by: Rich Collins
The object in the list that you pass to the method where ph_type matches contact_number.ph_type will be selected.
sorry should have previewed:
The object in the list that you pass to the method where ph\_type matches contact\_number.ph\_type will be selected.