Sha256: 72f27074f5f6efc67bed0872576723a8a9c7b079aeb340605ece0e292cc74675

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

TagTools is a simple ruby library for managing folksonomy tags within a Rails
applications.  It supports tagging of any number of database tables (i.e.,
you can tag different types of data using the same mechanism).  It can merge
tags, delete tags, and rename tags.  TagTools uses a fully normalized tag
schema.

== Example
 class User < ActiveRecord::Base
 end
 class Tag < ActiveRecord::Base
   def inspect
     return "tag:" + self.name.inspect
   end
   def to_s
     return self.name
   end
 end
 class Bookmark < ActiveRecord::Base
   acts_as_taggable :scope => :user
 end
 
 current_user = User.new
 current_user.name = "Joe Schmoe"
 current_user.save
 slashdot_bookmark = Bookmark.new
 slashdot_bookmark.url = "http://slashdot.org"
 slashdot_bookmark.save
 slashdot_bookmark.user_tags(current_user.id).concat( "geeky", "news", "technology" )
 slashdot_bookmark.tags
 => [ tag:"geeky", tag:"news", tag:"technology" ]
 slashdot_bookmark.user_tags(current_user.id).delete( "news" )
 slashdot_bookmark.tags
 => [ tag:"geeky", tag:"technology" ]
 slashdot_bookmark.user_tags(current_user.id).concat( "technology", "linux" )
 slashdot_bookmark.tags
 => [ tag:"geeky", tag:"technology", tag:"linux" ]
 Bookmark.tag_query( :with_any_tags => ["linux"] )
 => [ #<Bookmark:0x77dc54 @attributes={"url"=>"http://slashdot.org"}> ]

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tagtools-0.0.3 README
tagtools-0.0.2 README