# Removing tags with acts\_as\_taggable plugin?

**URL:** <https://www.ruby-forum.com/t/removing-tags-with-acts-as-taggable-plugin/83445>\
**Category:** Rails\
**Created:** [January 26, 2007, 3:28am UTC](https://www.ruby-forum.com/t/removing-tags-with-acts-as-taggable-plugin/83445 "2007-01-26T03:28:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [January 26, 2007, 3:28am UTC](https://www.ruby-forum.com/t/removing-tags-with-acts-as-taggable-plugin/83445/1 "2007-01-26T03:28:08Z")

</div>

I’m adapting the acts\_as\_taggable plugin and it strikes me as odd that  
nobody seems to have ever dealt with the fact that it doesn’t include a  
means to remove tags. It’s recommended in the Rails Recipes book and  
I’ve seen other posters on the mailing list and Rails Wiki recommending  
it, but hasn’t anybody ever wanted to remove a tag?

I’m just learning more about polymorphic associations, so I’m sure it  
will be clear once I understand them more, but for now I am having  
trouble working out how to do a few things:

1. remove a specific tag from an object
2. determine if an object includes a tag named X
3. make sure all the tags on my object are unique, that it doesn’t have  
duplicated tag names

Any pointers?  
Thanks!

Jeff

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [January 26, 2007, 9:26am UTC](https://www.ruby-forum.com/t/removing-tags-with-acts-as-taggable-plugin/83445/2 "2007-01-26T09:26:22Z")

</div>

1. haven’t implemented that so I can’t tell you
2. mytaggedobject.tags.find\_by\_name(tagiamlookingfor)
3. you’ll have to add this yourself in acts\_as\_taggable.rb, using uniq  
to filter the list passed in by the user should work I think.

Good Luck!

On Jan 25, 6:28 pm, Jeff C.man [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [January 26, 2007, 1:48pm UTC](https://www.ruby-forum.com/t/removing-tags-with-acts-as-taggable-plugin/83445/3 "2007-01-26T13:48:14Z")

</div>

My acts\_as\_taggable\_on\_steroids plugin may be of use. I added the  
uniqueness  
checking for tag names just today, what good timing ;).

[http://svn.viney.net.nz/things/rails/plugins/acts\_as\_taggable\_on\_steroids](http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids)

-Jonathan.
