form helper time_select "1 week", "11 days", etc ...

14 views
Skip to first unread message

fugee ohu

unread,
Dec 1, 2015, 1:32:17 PM12/1/15
to Ruby on Rails: Talk
I have a time field named duration and i wanna create a select list with options in the model for "1 week", "11 days" I know how to create for a basic select but not for time

Colin Law

unread,
Dec 1, 2015, 4:16:12 PM12/1/15
to Ruby on Rails: Talk
I have not tried it, but I would be surprised if giving the select box
elapsed time values (such as 1.week, 11.days, the difference of two
Time values, and so on) did not just work. Have you tried?

Colin

fugee ohu

unread,
Dec 1, 2015, 5:11:31 PM12/1/15
to Ruby on Rails: Talk
yea, i tried that in the model i got goofy results something about nil i forget what so i did some reading and it looks like i should change the field type to integer and store values in seconds and then let my app work with that data
Reply all
Reply to author
Forward
0 new messages