Nested form update action producing duplicate results

前端 未结 2 621
旧时难觅i
旧时难觅i 2021-01-22 06:20

During the update action of a nested form, instead of updating the current nested records, it seems to create new nested records.

This is what my controller looks like

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-22 07:15

    Try adding update_only to your call to accepts_nested_attributes_for.

    accepts_nested_attributes_for :nested_attribute, update_only: true
    

提交回复
热议问题