If you can't update a nested object, getting a message like:
Failed to remove the existing associated parent.
The record failed to save after its foreign key was set to nil
you're probably not permitting the nested ID parameter to be used. Check your strong parameters #permit
to ensure that you're permitting the :id
parameter on the nested attributes.