In the view you can do the following:
<%= f.time_select :start_time,
:combined => true,
:default => Time.now.change(:hour => 11, :min => 30),
:minute_interval => 15,
:time_separator => "",
:start_hour => 10,
:end_hour => 14 } %>
This will create a combined time select starting at 10 AM and going till 2 PM with 15 minute intervals with a default of 11:30 AM. This will set the value for the start_time attribute on the object this form was created for.
On the controller side, we need to parse this attribute before we create a new object. combined_time_select provides a nice method for this called parse_time_select!. You can use this in your create action just before you initialize the new model:
def create
params[:event].parse_time_select! :start_time
@event = Event.new params[:event]
end
And voila! You're all set.