This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Matthew Van Horn (author)
Thu Jun 04 09:14:10 -0700 2009
commit f00239453e327f77072362df2fffe6bf35173f33
tree b90195e44d03a123308a74c82214d5ff10a62ffa
parent 4f7ccfb7b8c4b5aabcd418e5f093b0773376692f
tree b90195e44d03a123308a74c82214d5ff10a62ffa
parent 4f7ccfb7b8c4b5aabcd418e5f093b0773376692f
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Oct 30 13:45:33 -0700 2008 | |
| |
CHANGELOG | Wed Mar 12 00:13:25 -0700 2008 | |
| |
MIT-LICENSE | Wed Mar 12 00:13:25 -0700 2008 | |
| |
OLD_README | Wed Nov 05 05:57:16 -0800 2008 | |
| |
README | Wed Jul 01 09:53:00 -0700 2009 | |
| |
Rakefile | ||
| |
acts_as_commentable.gemspec | ||
| |
generators/ | Tue May 19 16:04:51 -0700 2009 | |
| |
init.rb | Wed Jul 01 09:53:00 -0700 2009 | |
| |
install.rb | Tue May 19 15:27:47 -0700 2009 | |
| |
lib/ | ||
| |
rails/ | ||
| |
tasks/ | Wed Mar 12 00:13:25 -0700 2008 | |
| |
test/ | Wed Mar 12 00:13:25 -0700 2008 |
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
* To install as a gem
sudo gem install
Merb/Rails
* To install as a gem:
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install jackdempsey-acts_as_commentable
add the folloowing line to your environment.rb
config.gem 'jackdempsey-acts_as_commentable', :lib => 'acts_as_commentable', :source => "http://gems.github.com"
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








