views:

99

answers:

1

there is an example provided on how to add tags to a model with is_taggable, and it works very nice (working in 5 minutes)

Now, I also need the opposite, show all records that are tagged with a certain word.

Something like:

ModelWithTag.find_by_tags "foo"

or

find_all_tagged_with "foo"

Is this possible with is_taggable ?

+1  A: 

Yes, you would do:

Tag.where(:name => 'english').first.taggings

which would get you the list of all items tagged with 'english'

Cheers,

Nazgum