Hi guys,
I’m having problems with my app. First of all, I created a date_select
with the code:
<%= date_select(‘contact’, ‘birthday’, :order => [‘day’,‘month’,‘year’])
%>
In the contacts table, I create a date field:
birthday DATE
When I save the values goes wrong into the database. From the log:
INSERT INTO contacts (“name”, “nickname”, “home_page”, “mobile”,
“birthday”, “phone”, “user_id”, “address”, “email”) VALUES(‘test’,
‘test’, ‘test’, 12345, ‘0010-01-01’, 12345, 2, ‘test’, ‘[email protected]’);
I already put the following code in my environment.rb.
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
:default => ‘%m/%d/%Y’,
:date_time12 => “%m/%d/%Y %I:%M%p”,
:date_time24 => “%m/%d/%Y %H:%M”,
)
And the date are still displayed as year, month, day.
How can I change this behavior?
Thanks in advance.
Fernando L.