How to remove rows from connection table using ActiveRecord?
1 answer
Suppose you have one page and one tag.
# This will add a "tags_pages" entry, linking one page to one tag
page.tags << tag
# This will delete the appropriate "tags_pages" entry
page.tags.delete(tag)
You can also remove all tags associated with a single page using the method clear.
page.tags.clear
+8