ryanb / nested_form

Rails plugin to conveniently handle multiple models in a single form.
MIT License
1.79k stars 505 forks source link

double nested form #287

Open abacha opened 10 years ago

abacha commented 10 years ago

I'm trying to create two nested forms for the same relation but with different forms but when I click on the 'add' button on the form A, it creates a line like line B

richardrails commented 10 years ago

have you fixed that?

Startouf commented 9 years ago

Might be related to this one ? https://github.com/ryanb/nested_form/issues/288

camilosad commented 9 years ago

any sugestion?

Startouf commented 9 years ago

Try to specify data target :

<%= f.link_to_add 'add new', :your_association, :data => { :target => "#your_association-#{f.index}"}

And don't forget to wrap your fields inside a tag with the .fields class

(You might want to have a look at https://github.com/ryanb/nested_form/issues/343)

camilosad commented 9 years ago

Thanks friend!