






























Demetrius Nunes has a very cool acts-as mixin ready for you in a single line. It allows you to do stuff like:
class Photo < ActiveRecord::Base
acts_as_taggable
end
elephant = Photo.find(4437)
elephant.tag 'zoo animals nature'
elephant.tagged_by?('urban') # => false
elephant.tags.size # => 3
elephant.tag_names => [ 'zoo', 'animals', 'nature' ]
Without any real effort at all. Neato. It’s pending as a patch too, so it’ll most likely make it into the next version.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。