ryanb / nested_form

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

Problem with Add New Nested Field #341

Open sirius248 opened 9 years ago

sirius248 commented 9 years ago

Click on Add then everything work. Click on save then it show 2 duplicate fields. I already remove TurboLink & checked for duplicate javascript require under application.js. But nothing works.

ramonsnir commented 9 years ago

Do you have allow_destroy on your model's accept_nested_attributes_for? nested_form does work, it doesn't seem like an issue with it.

sirius248 commented 9 years ago

I did have allow_destroy. But does not work at all. I'm thinking of another reason. Which might cause it save twice to the database.

I do before_filter in the controller, and there was only 1 field submitted (which is correct) but for some reason I save twice to the database. Not quite sure it's because of nested_form though