Plugins - Acts As Bookmarkable

StarAdd to favorites

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

Cosmin Radoi

http://www.juixe.com/techknow/index.php/2006/07/05/acts-as-bookmarkable-plugin/

http://juixe.com/svn/acts_as_bookmarkable/

Rails' (MIT)

  • Currently 4.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?