This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
forked from jackdempsey/acts_as_commentable
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Acts As Commentable | ||
|
||
Allows for comments to be added to multiple and different models. | ||
|
||
### Forked | ||
* Added Rails 3.2 support | ||
* Removed default scope on comments | ||
|
||
### Installation | ||
|
||
`gem install "acts_as_commentable"` | ||
|
||
If using bundler then just add | ||
`gem "acts_as_commentable"` to your Gemfile | ||
and | ||
`bundle install` | ||
|
||
Generate your comment model: | ||
|
||
`rails g comment` | ||
|
||
Then migrate your database: | ||
|
||
`rake db:migrate` | ||
|
||
### Usage | ||
|
||
Make your ActiveRecord model act as commentable. | ||
|
||
class Post < ActiveRecord::Base | ||
acts_as_commentable | ||
end | ||
|
||
Add a comment to a model instance | ||
|
||
post = Post.create | ||
post.comments.create(:comment => "my first comment!") | ||
|
||
Fetch comments for a commentable model: | ||
|
||
post = Post.find(1) | ||
comments = post.comments.recent.limit(10).all | ||
|
||
|
||
### Credits | ||
|
||
**Xelipe** - This plugin is heavily influenced by Acts As Taggable. | ||
|
||
###### Contributors | ||
|
||
Jack Dempsey, Chris Eppstein, Jim Ray, Matthew Van Horn, Ole Riesenberg, ZhangJinzhu, maddox, monocle | ||
|
||
###### More | ||
|
||
[http://www.juixe.com/techknow/index.php/2006/06/18/acts-as-commentable-plugin/](http://www.juixe.com/techknow/index.php/2006/06/18/acts-as-commentable-plugin/) | ||
[http://www.juixe.com/projects/acts_as_commentable](http://www.juixe.com/projects/acts_as_commentable) |
This file was deleted.
Oops, something went wrong.