Skip to content

avo-hq/rails_comments

Repository files navigation

RailsComments

Still in beta

A modern way to add comments to your Rails app powered by Hotwire.

Installation

Add this line to your application's Gemfile:

gem "rails_comments"

And then execute:

$ bundle

Usage

  1. Include the RailsComments::Commentable module to the model you want to add comments.
class Post < ApplicationRecord
  include RailsComments::Commentable
end
  1. Add the assets to your layout file
<!-- app/views/layouts/application.html.erb -->
<%= rails_comments_assets %>
  1. Add the thread to your model's show page.
<!-- app/views/posts/show.html.erb -->
<%= comments_for @post %>
  1. Mount the engine
# config/routes.rb
mount RailsComments::Engine => "/rails_comments"
  1. Copy the migrations
bin/rails rails_comments:install:migrations
bin/rails db:migrate

Still to do

There are still a few things that need to be done in order to make this a full-featured commenting gem. If you want to help out we're glad to help you navigate the codebase.

  • send emails
  • custom author (the database supports that the external APIs don't)

License

The gem is available as open source under the terms of the MIT License.

About

Opinion is a modern comments engine for Ruby on Rails.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published