If you want some semantic in your web application the first thing that maybe you remember is to add some tags to your contents. This can be done automatically, or with some user help.
Act as Taggable easily integrates a tag system in your Rails application. It allows users to create tags in the model or models that you want. Imagine that you have a user and a photo model. Now you want to allow users to tag the photos, acts as taggable do all that for you.
The On Steroids version of Act as Taggble has also some methods to create Tag Clouds. Tag Clouds is nowadays a better and common way to represent terms and their importance, making the most important/searchable terms bigger and consequently most visible.
So, to install the Acts As Rateable plugin run the following command:
ruby script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids
Examples:
post.tag_list.add(“nice”, “interesting”) – Adds the tag nice and interesting to the post;
post.tag_list.remove(“funny”) – Removes the tag funny from the post;
Post.find_tagged_with(“nice”) – Returns all the post that have the tag nice;
Note: Do not forget to add acts_as_taggable to the model you want to make taggable.
I have to add some others fields to the taggable migration, because I want to identify the autor of the tag. So I added the field user_id.
For more information about this plugin you can search on:
http://agilewebdevelopment.com/plugins/acts_as_taggable_on_steroids
Greetings,
Hélder Loureiro
Wednesday, October 28, 2009
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment