Question

I am using Rails 3.1 and first time using datetime_select. I want to specify the minute select box to have 15 minute intervals rather than 1 minute intervals:

  <%= f.datetime_select :start_datetime, :ampm => true, :start_minute => [0,15,30,45] %>

But this doesn't seem to work. The :start_datetime is what the property is called in the Event model. Is it possible that this is a reserved word that is causing problems?

Était-ce utile?

La solution

Try passing :minute_step => 15

<%= f.datetime_select :start_datetime, :ampm => true, :minute_step => 15 %>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top