Problems using nested_attributes and devise

0

I'm creating a user settings form that uses devise, I'm using nested attributes, but for some reason the settings registry is not updated, but rather deleted, does anyone have any idea what's going on?

Form: link Console log: link

(Also has this id that is passed in the form via a hidden_input that I would like to remove)

Thank you for your attention!

    
asked by anonymous 12.10.2017 / 23:54

1 answer

0

Yes, I was being very dumb and forgot the importance of the id, it was only leave the same as allowed attribute that began to occur the update and not the destroy. But the id gets saved with "hidden_field", which is a tremendous security breach leaving it like this, so I created logic in the controller to get the id of the user setting without receiving via form, and I disabled the id via hidden_input using " include_id: false "in" fields_for ".

    
13.10.2017 / 00:58