Forum: Ruby on Rails Save date in database

Posted by 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
Posted by 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 (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.