Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used twice in the same page #107

Open
arefinforbd opened this issue May 29, 2019 · 1 comment
Open

Used twice in the same page #107

arefinforbd opened this issue May 29, 2019 · 1 comment

Comments

@arefinforbd
Copy link

I am using nested_fields_for in a partial page and the partial page is being used twice in the same main page.

"add_nested_fields_link" is working fine for the rendered first partial page but not for the second one.

@aseroff
Copy link

aseroff commented Jun 11, 2019

Assuming that your add_nested_fields link for the 2nd form is adding them to the first form.

To solve, check this section out: https://github.com/ncri/nested_form_fields#custom-container

Solve by giving the location you want the new fields to go to a unique id (eg <tbody id ="1">), then specify each name on each add fields link (eg form.add_nested_fields_link :obj, data: { insert_into: "1" }).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants