Forum: Ruby on Rails Save date in database

F62b11411959428908d84657e23dec47?d=identicon&s=25 Lauris Zaicevs (viktors91)
on 2012-04-23 14:57
Hi!

I have a question. I need to save any date which i choose in date_select
tag.  But all the time ruby return default time - 2000-01-01 00:00:00
UTC!! No matter which year or month or day i chooce it returns me
default date.

Can someone give me a solution of this problem.

Thank you
15eb13d662803f57bc4aea59704988b4?d=identicon&s=25 Scott Ribe (Guest)
on 2012-04-23 15:29
(Received via mailing list)
On Apr 23, 2012, at 6:57 AM, Lauris Zaicevs wrote:

> I have a question. I need to save any date which i choose in date_select
> tag.  But all the time ruby return default time - 2000-01-01 00:00:00
> UTC!! No matter which year or month or day i chooce it returns me
> default date.

Debugging 101: you're either not saving the value it into the database,
or you're not retrieving the row from the database, or you're not
setting the value in the HTML. So first read the output of the server,
and maybe add a couple of print statements at strategic places, to
figure out which it is. Then you can figure out why that step is not
happening.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.