Is there already a convenient way to create a Date object from request parameters? I can, of course, put it together from the individual mydate(1i) et al. and write a helper function that does this for me. Somehow, though, I think that this task is so common that there must be a better solution already available. Scaffolded controllers appear to be doing this somehow for dates. Michael -- Michael Schuerig Those who call the shots mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Are never in the line of fire http://www.schuerig.de/michael/ --Ani DiFranco, Not So Soft
On 14.4.2005, at 22:24, Michael Schuerig wrote:> > Is there already a convenient way to create a Date object from request > parameters? I can, of course, put it together from the individual > mydate(1i) et al. and write a helper function that does this for me.date_select("project", "deadline") will create the date widget. In the receiving action, saying @project = Project.new(@params["project"]) will set up @project.deadline automatically, assuming it''s a datetime or timestamp type field. //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Thursday 14 April 2005 21:40, Jarkko Laine wrote:> On 14.4.2005, at 22:24, Michael Schuerig wrote: > > Is there already a convenient way to create a Date object from > > request parameters? I can, of course, put it together from the > > individual mydate(1i) et al. and write a helper function that does > > this for me. > > date_select("project", "deadline") will create the date widget. > > In the receiving action, saying @project > Project.new(@params["project"]) will set up @project.deadline > automatically, assuming it''s a datetime or timestamp type field.Ah, thanks. I had recreated a hash with params to the AR created from the request. With hindsight that wasn''t too smart... Michael -- Michael Schuerig Life is just as deadly mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org As it looks http://www.schuerig.de/michael/ --Richard Thompson, Sibella