I had to add :id
to the permitted params in the survey_params
method. It now looks like this:
# Never trust parameters from the scary internet, only allow the white list through.
def survey_params
params.require(:survey).permit(:name, questions_attributes: [:id, :content])
end
which works perfectly. I guess new id’s were generated instead of being passed to the update action.