Search code examples
ruby-on-rails-3formstime-select

How to make to combine time_select into one drop down menu?


I`m currently using:

<%= f.time_select :day,:default => Time.now, :ampm => true, :minute_step => 15 %>

Which gets display as two separate boxes, one for select_hour & one for select_minutes.

Is there a simple way to combine them, so I`ll get 6:00 / 6:15 / 6:30 / 6:45 ?

Thanks for the help!


Solution

  • I don't think there is an easy way to do this. I think you might be best served folding your own with:

    options_for_select
    

    see: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html