In all the examples I could find, date attributes that come from date helpers are set like so: Thing.update_attributes(@params[''datefield'']) I''m in a situation where I need to create record manually but still assign a date to it that comes from a date_select. For example: Thing.new do |t| t.name = ''somename'' t.age = 12 t.date_of_birth = # what to put here? t.save end Thanks for your help. Carl
Carl Youngblood <carl@...> writes:> > In all the examples I could find, date attributes that come from date > helpers are set like so: > > Thing.update_attributes( <at> params[''datefield'']) > > I''m in a situation where I need to create record manually but still > assign a date to it that comes from a date_select. For example: > > Thing.new do |t| > t.name = ''somename'' > t.age = 12 > t.date_of_birth = # what to put here? > t.save > end > > Thanks for your help. > > Carl >Hi Carl, If you mean just putting in a literal value then the format is YYYY-MM-DD. Cheers. Ravi
I guess I''m wondering if there is a shortcut or helper that I can do this with or if I just need to concetenate the stuff together myself. On 10/26/05, Ravi Dhupar <rdhupar-B05ky7EdRHze9wHmmfpqLFaTQe2KTcn/@public.gmane.org> wrote:> If you mean just putting in a literal value then the format is YYYY-MM-DD.