Hadn't realized that you were trying to specify "Problem" as the default. Note that if your :value method gives another result for "Problem", like for example, 1, then you have to change the selected field accordingly.
<%= select_tag(:event_status, options_for_select([""]) + options_from_collection_for_select (@event_status_list, :value, :detail, "Problem")) %> On Apr 9, 2:53 pm, Jaryl Sim <[email protected]> wrote: > <%= select_tag(:event_status, options_for_select([""]) + > options_from_collection_for_select > (@event_status_list||"Problem", :value, :detail, @selected_status)) > %> > > Seehttp://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelp... > > On Apr 9, 12:34 pm, Phlip <[email protected]> wrote: > > > Valentino Lun wrote: > > > <%= select_tag(:event_status, options_for_select([""]) + > > > options_from_collection_for_select(@event_status_list, :value, :detail)) > > > %> > > > The trick is recognizing options_from_collection_for_select(), not > > select_tag(), > > creates the <options>, and only they can use the selected='selected' > > attribute. > > > Google for options_from_collection_for_select() and "default value"... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

