Rails view - user enters minutes, we save seconds?

Posted by sscirrus on Stack Overflow See other posts from Stack Overflow or by sscirrus
Published on 2010-05-29T19:19:01Z Indexed on 2010/05/29 19:22 UTC
Read the original article Hit count: 148

Filed under:
|
|

Hi everyone,

I have a simple text_field in my form where a user enters a time in minutes, i.e. 60.

How can I multiply that number by 60 before saving the form, such that the database stores the number in seconds?

Then, how do I reverse that and show the field in minutes on another view?

Thank you!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about forms