Anil Wadghule
2006-Sep-12 07:38 UTC
How to display date_of_birth field column in db having type DateTime using select boxes Date, Month and Year only, Please help!
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Dominique Plante
2006-Sep-12 09:02 UTC
Re: How to display date_of_birth field column in db having t
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 Wadghule 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-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---