For those who find it with Google, although technically the deletion flag may be correct, I think this is confusing - the only advantage is that it takes two clicks to delete (select the field and click "Update"). Perhaps it would be better to just make sure that the deletion is clear what is happening, and perhaps add an easy way to get it back.
Next, send the update to the server as ajax in order to process the page update in the callback or in the js view file. Remove the remote: true and it will work as a normal link.
# For my form I build a new object if it missing, # so I need to check that this is not a new nested attribute. - unless question.answers.new_record? # Basically, I am sending over the fields that would be sent # by the _delete check box form being updated. = link_to "Delete", question_path(question.id, question: { answers_attributes: { id: question.answers.id, "_destroy" => true }}), remote: true, confirm: "Really delete?", method: :put
source share