Re: Database saving empty records

Whiplash
Fri, 10 Jul 2009 21:58:51 -0000

Thanks Fred, starting to understand now. :-)

Dana


On Jul 10, 8:59 am, Frederick Cheung
<frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> On Jul 10, 4:46 pm, Whiplash
<danapelle...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > @motorcycle= Motorcycle.new
> > @motorcycle.make = params[''make'']
> > @motorcycle.model = params[''model'']
> > @motorcycle.year = params[''year'']
> > @motorcycle.save
>
> > And that works!
>
> > So my question becoms, why do I have to manually assign the parameters
> > when using form_tag, and I don''t when using form_for?
>
> Because form_for by default stuck your parameters in params
> [:motorcycle], but the fields you created in the other case where at
> the top level
>
> Fred
>
> > Thanks
>
> > Dana