Reputation: 350
I'm new to Rails and I want to create a simple time calculator: User is presented with 2 dropdown menus that capture user inputs “hour” and “minutes”, so I can get time like 7:15. Then after some math on this time the user is given several “hour:minute” time options. What is the best way to build this logic and what helper to use? Should I create models for hours and minutes?
Upvotes: 2
Views: 1028
Reputation: 418
You can build up the hour and minutes drop down.
<%= f.select :hours, '1'..'24' %>
<%= f.select :minutes, '01'..'59' %>
or you can use gem
Upvotes: 2