Remove object from has_many but don't delete the original record in Rails?
You should not use the delete
method on the Paragraph
object, but instead use the delete method of paragraphs
relation, like this:
post.paragraphs.delete(Paragraph.find(paragraph_id))