Skip to content
This repository has been archived by the owner on Jun 22, 2019. It is now read-only.

daemonsy/lazy_comments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lazy_comments

Not that anyone will use this, but it's good to state so. This is not suitable for real use

Simple commenting gem that gives you tag any AR model with has_comments and adding comments to it.

Requirements

  • Rails 4
  • ActiveRecord
  • Haml (currently, generated views use HAML only)

Installation

gem 'lazy_comments'
rails g comments # Generates controllers, models, views and migrations

Usage

class Post < ActiveRecord::Base
  has_comments
end

Add a comment to your model:

post = Post.new
post.comments.build(message: "hello") 

Find Comments:

post = Post.find(13)
Comment.for_subject(post)
post.comments.where(user: current_user)

Comments belonging to a group:

# Essentially group is a string that can be anything
Comment.in_group("hello_world")

Helpers

Feature not committed yet, coming soon!

About

Commenting gem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published