nested_form icon indicating copy to clipboard operation
nested_form copied to clipboard

double nested form

Open abacha opened this issue 11 years ago • 5 comments

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

abacha avatar Sep 05 '13 21:09 abacha

have you fixed that?

richardrails avatar Apr 17 '14 15:04 richardrails

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

Startouf avatar Nov 09 '14 21:11 Startouf

any sugestion?

camilosad avatar Nov 14 '14 12:11 camilosad

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)

Startouf avatar Nov 14 '14 12:11 Startouf

Thanks friend!

camilosad avatar Nov 14 '14 15:11 camilosad