I want to use "acts-as-taggable-on" gem for my rails app. (rails 3.0.10 and ruby 1.9.2p0)
but I am using mongoid.
as "acts-as-taggable-on" works on AR, is there any way to use this for mongo.
or is there any other gem available for tagging which can be use with mongo.
Here are a couple of existing solutions for mongoid:
https://github.com/wilkerlucio/mongoid_taggable
http://abhishiv.tumblr.com/post/3623498128/introducing-acts-as-taggable-for-mongoid
However, it's easy enough to write your own tagging functionality using a has_and_belongs_to_many association and a couple of methods in your model:
has_and_belongs_to_many :tags
attr_accessor :tag_list
def tag_list=value
value.split(',').each do |tag|
self.tags.build(:name => tag).save
end
end
def tag_list
self.tags.join(',')
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With