Default value not set in select
can anyone see why "9:00" isn't selected in this select?
=f.fields_for :hours do |hours_form|
= hours_form.text_field :start_time # outputs "9:00"
=hours_form.select :start_time, possible_hours_stop() # outputs a select including one where va开发者_StackOverflowlue="9:00"
Shouldn't "9:00" be selected since that's the value of :start_time?
I would try this:
=hours_form.select :start_time, options_for_select(possible_hours_stop(), hours_form.object.start_time)
精彩评论