How to display date_of_birth field column in db having type

Hi all,

I want to display select boxes for selecting data_of_birth. I want only
three select boxes for selection of day, month and year. And it should
be
tied with model. I tried ‘datetime_select’. But it displays some extra
select boxes for selecting time. Also it displays order Year, Month and
day.
I want order to be Day, Moth, Year. I don’t want to select time. But my
table have column date_of birth having type DateTime.

Please give me some guidelines


Don’t live to geek; geek to live.
http://anildigital.blogspot.com

Dear Anil:

I just tried the following and it works (even with your column being a
datetime):

<%= date_select ‘my_entity’, ‘date_of’, {:order => [:month, :day,
:year]} %>

From looking at data after updating to db, I saw that the timestamp
portion was being set to 00:00 in sqlite3.

I was inspired by:
http://rails.techno-weenie.net/question/2006/6/30/reconstructing-a-date-from-date_select

I tried <%= datetime_select ‘my_entity’, ‘date_of’, {:order => [:month,
:day, :year]} %>, and this did do what I expected it to do.

Hope this helps!
Dominique

Anil W. wrote:

Hi all,

I want to display select boxes for selecting data_of_birth. I want only
three select boxes for selection of day, month and year. And it should
be
tied with model. I tried ‘datetime_select’. But it displays some extra
select boxes for selecting time. Also it displays order Year, Month and
day.
I want order to be Day, Moth, Year. I don’t want to select time. But my
table have column date_of birth having type DateTime.

Please give me some guidelines


Don’t live to geek; geek to live.
http://anildigital.blogspot.com