开发者

How to update datetime field

开发者 https://www.devze.com 2022-12-14 10:09 出处:网络
What is the best way to update a datetime field in a form. I have a form and need to update both the date and the time.

What is the best way to update a datetime field in a form.

I have a form and need to update both the date and the time.

I need to update the date with a date_select and then update the time using a time_select

I only have 1 field in my database. Event:date

I need to save the date in one field and then update the same field but add the date.

It has to be that way for the user to pick them separately. But it has to be one table in the database for the calendar.

--------------Form
Select Date :  Dateselect  saving to db:field  :Starttime
Select Time :  Timeselect  saving 开发者_运维技巧to db:field  :Starttime


There's select_datetime for this:

http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001701


Try using the calendar_date_select gem. It lets you select date and/or time with one control. http://code.google.com/p/calendardateselect/

0

精彩评论

暂无评论...
验证码 换一张
取 消