Hi All
In my project I am to take date of birth from user so I used
datetime_select. It renders three selection boxes, year, month and day.
But
I want order as day, month and year. I added :order option for
datetime_select, it renders normal selection boxes with order year,
month
and day. Why :order does not work with datetime_select? see my following
code
<%= datetime_select(:user2, :date_of_birth,
:discard_hour => true,
:start_year => 2000,
:end_year => 1910,
:order => [:day, :month, :year])
%>
here :order is ineffective.
Also I want to add id for every select box generated, Please tell em if
there is any way to do that.
Regards,
Anil W.
Don’t live to geek; geek to live.
http://anildigital.blogspot.com
Anil W. wrote:
Hi All
In my project I am to take date of birth from user so I used
datetime_select. It renders three selection boxes, year, month and day.
But
I want order as day, month and year. I added :order option for
datetime_select, it renders normal selection boxes with order year,
month
and day. Why :order does not work with datetime_select? see my following
code
<%= datetime_select(:user2, :date_of_birth,
:discard_hour => true,
:start_year => 2000,
:end_year => 1910,
:order => [:day, :month, :year])
%>
here :order is ineffective.
Also I want to add id for every select box generated, Please tell em if
there is any way to do that.
Regards,
Anil W.
Don’t live to geek; geek to live.
http://anildigital.blogspot.com
If you just need day, month, year for the birthday (imagine so)
try date_select instead:
<%= date_select :user2, :date_of_birth, :order => [:day, :month, :year]
%>
This works for me.
karen