# Oli Comments
Oli Comments provides an easy-to-configure commenting system.
## Installation
Add this line to your application’s Gemfile:
gem 'oli_comments'
And then execute:
$ bundle install
Once you have bundled it, you should run the installation generator:
$ rails g oli_comments:install
Migrate
$ rake db:migrate
## Usage
Once installed, configure important stuff in ‘config/initializers/oli_comments.rb` #not implemented yet
This gem uses cancan for permissions on who can comment/reply. Define permissions in your own ability model. This gem also requires a @current_member object when someone is logged in.
-
Add ‘commentable’ to any model to which you would like to add comments.
class Recipe < ActiveRecord::Base commentable ... ... end
-
Implement ‘commenters’ on that model to return an array of members who should be notified in case someone posts a comment.
class Recipe commentable ... def commenters [self.member] end ... end
-
Add the comments to the view of the commentable object:
= render 'comments/comments', commentable: @myobj
## Todo:
-
Add config for member image method
-
Add CanCan to engine
## Contributing
-
Fork it
-
Create your feature branch (‘git checkout -b my-new-feature`)
-
Commit your changes (‘git commit -am ’Add some feature’‘)
-
Push to the branch (‘git push origin my-new-feature`)
-
Create new Pull Request