how set time_select value in model
I have a object attr. called duration, its datatype is datetime.
I'm displaying this value using a time_select.
This generates several hidden text fields.
This is my page:
I want to set in the model hours and minutes to 00:00 when I select an option from a dropdown (a virtual attr.)
<%= f.time_select :duration, :minute_step => 10 %>
But this is crashing.
if(val == I18n.t(:days))
How could I do this ?