Skip to content

opuslogica/oli_comments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# 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.

  1. Add ‘commentable’ to any model to which you would like to add comments.

class Recipe < ActiveRecord::Base
    commentable
    ...
    ...
end
  1. 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
  1. Add the comments to the view of the commentable object:

= render 'comments/comments', commentable: @myobj

## Todo:

  1. Add config for member image method

  2. Add CanCan to engine

## Contributing

  1. Fork it

  2. Create your feature branch (‘git checkout -b my-new-feature`)

  3. Commit your changes (‘git commit -am ’Add some feature’‘)

  4. Push to the branch (‘git push origin my-new-feature`)

  5. Create new Pull Request

About

The generic comments gem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published