Re: Re: How to create a custom time select form element?

Colin Law
Sun, 14 Aug 2011 07:30:31 -0000

On 14 August 2011 07:42, Andrew
<misbehavens-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> I could easily write the HTML to create a few select elements, however,
it''s the Ruby part that I am not as familiar with. Could you provide an
example of what the controller code (or model, helper, etc) would look like to
convert the 3 fields into a valid time value ready to store in a database?

Just take the params values and convert them into a Time object.
Time.utc or Time.local may be useful.

Colin

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.