If you're interested in deleting all the tags, you can send delete_all
to the relation.
Short example
> resource.grades.delete_all
> resource.reload
> resource.grades
=> []
Long example
> resource.grades
=> [#<ActsAsTaggableOn::Tag id: 336486, name: "Kindergarten", context: nil, sort: 0>,
#<ActsAsTaggableOn::Tag id: 336506, name: "Pre-K", context: nil, sort: 0>]
> resource.grades.delete_all
(0.3ms) BEGIN
SQL (0.5ms) DELETE FROM `taggings` WHERE `taggings`.`taggable_id` = 984643 AND `taggings`.`taggable_type` = 'Resource' AND `taggings`.`tag_id` IN (336486, 336506) AND (taggings.context = 'grades')
(0.2ms) COMMIT
=> [#<ActsAsTaggableOn::Tag id: 336486, name: "Kindergarten", context: nil, sort: 0>,
#<ActsAsTaggableOn::Tag id: 336506, name: "Pre-K", context: nil, sort: 0>]
> resource.reload
Resource Load (0.6ms) SELECT `resources`.* FROM `resources` WHERE `resources`.`id` = 984643 LIMIT 1
=> #<Resource id: ...>
> resource.grades
ActsAsTaggableOn::Tag Load (0.6ms) SELECT `tags`.* FROM `tags` INNER JOIN `taggings` ON `tags`.`id` = `taggings`.`tag_id` WHERE `taggings`.`taggable_id` = 984643 AND `taggings`.`taggable_type` = 'Resource' AND (taggings.context = 'grades')
=> []
@tag.destroy
should delete the tag, so something else must be interfering. – Orlosky