A
a_g_lyph
I have a Ruby project with a User object that consists of various
fields (attributes). Two of these are preferredStart and preferredEnd
and were configured with the "... script/generate scaffold ..."
command to have type "time". When I visit the resulting "New User"
page, the input for those two fields has date and time. In other
words, the user could select a month, date and year in addition to
hour, minute and second for preferredStart and preferredEnd. The
relevent code from the view/new_user.html.erb is:
<p>
<%= f.label referredStart %><br />
<%= f.datetime_select referredStart %>
</p>
<p>
<%= f.label referredEnd %><br />
<%= f.datetime_select referredEnd %>
</p>
<p>
Is there a way to limit the input selection to simply hour and
minute? I tried, for instance:
<%= f.datetime_select referredStart, prompt => {:hour =>
true, :minute => true} %>
That did not have the intended effect, though.
fields (attributes). Two of these are preferredStart and preferredEnd
and were configured with the "... script/generate scaffold ..."
command to have type "time". When I visit the resulting "New User"
page, the input for those two fields has date and time. In other
words, the user could select a month, date and year in addition to
hour, minute and second for preferredStart and preferredEnd. The
relevent code from the view/new_user.html.erb is:
<p>
<%= f.label referredStart %><br />
<%= f.datetime_select referredStart %>
</p>
<p>
<%= f.label referredEnd %><br />
<%= f.datetime_select referredEnd %>
</p>
<p>
Is there a way to limit the input selection to simply hour and
minute? I tried, for instance:
<%= f.datetime_select referredStart, prompt => {:hour =>
true, :minute => true} %>
That did not have the intended effect, though.