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?
The form_tag Rails helper generates a form withe the POST method by default, and it automatically renders the HTML that we were writing by hand before. Note: We can explicitly specify what HTTP verb to use for the form_tag if we want something other than POST .
This setting determines whether form_with generates remote forms or not. It defaults to true. Or maybe more commonly set in config/application.
Try passing :minute_step => 15
<%= f.datetime_select :start_datetime, :ampm => true, :minute_step => 15 %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With