-
Notifications
You must be signed in to change notification settings - Fork 4
Home
maxime edited this page Sep 13, 2010
·
13 revisions
It’s providing tagging support to DataMapper resources.
- git clone git://github.com/maxime/dm-is-taggable.git
- cd dm-is-taggable
- sudo rake install
- dependency ‘dm-is-taggable’ in your init.rb
- In your model:
class Post
include DataMapper::Resource
property :id, Serial
property :name, String
property :description, Text
is :taggable
end
post = Post.create(:name => “My First Post”) tasty = Tag.build(‘tasty’) original = Tag.build(‘original’) post.tag(tasty) post.tag(original) post.tags # returns [tasty, original] tasty.posts # returns [post] original.posts # returns [post] post.untag(tasty) post.tags.reload post.tags # returns [original]
- More Specs / Testing
- Tagger Support
- A form helper