On 6/21/05, Kelly Felkins
<kelly.felkins-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> What is the best (easiest) way to generate a form for a has_many
> relationship? For example, an order form with with a list of products /
line
> items. Is there a generator for this? Is there a generator for the line
> items? Is there a way to tell scaffold about this relationship?
>
> I think I understand and can build this by hand with partials, but I
> thought there may be a streamlined, rails way.
>
> Thanks
>
> -Kelly
Someone correct me if I am wrong, but to the best of my knowledge
there is no scaffold for this right now (anyone know if one is in the
pipeline?)
Currently, I accomplish this task as you suggest -- by hand using
partials. I just generate a series of checkboxes based on the
has_many end of the given habtm relationship. This not only requires
tweaking of your edit/new, but also create and update.
Matt