The ActiveRecord acts_as_commentable plugin
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 87 commits behind jackdempsey:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
generators/comment
lib
tasks
test
.gitignore
CHANGELOG
MIT-LICENSE
OLD_README
README
Rakefile
acts_as_commentable.gemspec
init.rb
install.rb

README

Acts As Commentable
=================

Allows for comments to be added to multiple and different models.

== Resources

Install

  Rails

   * To install as a plugin:
 
    script/plugin install http://github.com/jackdempsey/acts_as_commentable.git

  Merb/Rails
  
   * To install as a gem:
 
   rake install
 
 Generate your comment model:
 
 script/generate comment
 
 Then migrate your database:
 
 rake db:migrate

== Usage
 Merb Users:
 * add 'dependency "acts_as_commentable"' to your init.rb or dependencies.rb if using merb-stack
 
 * Make your ActiveRecord model act as commentable.
 
 class Model < ActiveRecord::Base
 	acts_as_commentable
 end
 
 * Add a comment to a model instance
 
 commentable = Model.create
 commentable.comments.create(:title => "First comment.", :comment => "This is the first comment.")

 * Fetch comments for a commentable model:
 
 commentable = Model.find(1)
 comments = commentable.comments.recent.limit(10).all

 # Following doesn't work/make sense to me. Leaving for historical sake -- Jack
 # * Each comment reference commentable object
 #
 # model = Model.find(1)
 # model.comments.get(0).commentable == model

== Credits

Xelipe - This plugin is heavily influenced by Acts As Taggable.

== More

http://www.juixe.com/techknow/index.php/2006/06/18/acts-as-commentable-plugin/
http://www.juixe.com/projects/acts_as_commentable