Yea i had to do the same thing, check here
http://github.com/alloy/complex-form-examples
On Thu, Oct 7, 2010 at 8:53 AM, jhaagmans
<jaap.haagmans-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi,
>
> I''m using a nested form to create an object. It looks something
like
> this:
>
> form_for @object do |f|
> f.label :name
> f.text_field :name
> fields_for :child_object do |child_form|
> render :partial => ''child_form_part'', :locals =>
{ :form =>
> child_form }
> end
> # here a link to create a new child object
> end
>
> Now, as you can see, I want to use an AJAX link to add a new child
> object to the form and show its partial in addition to the children
> that are already there. However, I don''t know how to do that. I
can
> use RJS to add the partial to the form using insert_html, but I''m
not
> sure how to pass along the local form object so I can build the form
> in the partial.
>
> Is there a good way to do this?
>
> Thank you.
>
> --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.