Links
Acts As Bookmarkable
Categories
Acts As Bookmarkable
A bookmarkable model can be any ActiveRecord class so you can use the acts_as_bookmarkable to bookmark other users in a friends list, or bookmark posts in a favorites list, etc. And following the Web 2.0 trends, bookmarks themselves can act as taggable so that you can label bookmarks with tags. You need to install the acts_as_taggable plugin separately, or you can remove one line in the bookmark.rb file to disable tags for bookmarks.
Usage
- Make your ActiveRecord model act as bookmarkable.
class Model < ActiveRecord::Base
acts_as_bookmarkable
end
- Add a bookmark to a model instance
model = Model.new bookmark = Bookmark.new(:title => ‘bmark title’) model.bookmarks << bookmark
- Each bookmark references the bookmarkable object
model = Model.find(1) model.bookmarks.get(0).bookmarkable == model
Vitals
| Home | http://www.juixe.com/techknow/index.php/2006/07/05/acts-as-bookmarkable-plugin/ |
|---|---|
| Repository | http://juixe.com/svn/acts_as_bookmarkable/ |
| License | Rails' (MIT) |
| Tags |
rate
|
| Rating | (13 votes) |
| Owner | Cosmin Radoi |
| Created | 6 July 2006 |
Comments
-
I am Cosmin Radoi and this is not my plugin. Please rectify. Thanks.

