Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add examples for add/remove tag

Add examples for adding one tag to tag list and removing one tag from tag list.
Based on the answer from stackoverflow
http://stackoverflow.com/questions/2109481/how-can-i-delete-the-tag-from-the-tag-list-of-the-act-as-tagg-plugin
  • Loading branch information...
commit ae77c4d9867a8dd3717e02b738ed0bd214886b78 1 parent 62f5fea
xmonkey authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 README.rdoc
7 README.rdoc
View
@@ -78,6 +78,13 @@ To preserve the order in which tags are created use acts_as_ordered_taggable:
@user.tag_list # => ["north", "east", "south", "west"]
+ @user.tag_list.add = "northeast"
+ @user.tag_list.remove = "east"
+ @user.save
+
+ @user.reload
+ @user.tag_list # => ["north", "south", "west", "northeast"]
+
=== Finding Tagged Objects
Acts As Taggable On utilizes named_scopes to create an association for tags.
Please sign in to comment.
Something went wrong with that request. Please try again.