The easiest way to add content moderation to your Rails app. Install the gem, add one line to your model, and get automatic content flagging with zero configuration.
Add content moderation to your Rails app in seconds
gem install content_flagging
# Gemfile
gem 'content_flagging'
rails generate content_flagging:install
rails db:migrate
class Post < ApplicationRecord
acts_as_flaggable # 🎯 That's it!
end
Works out of the box with sensible defaults
Efficient queries with proper indexing
Database-level counters prevent race conditions
Users can flag inappropriate content
Flag anything - posts, comments, users, you name it
Easy oversight and management tools
flag!(flagged_by: user) | Flag content |
unflag!(flagged_by: user) | Remove flag |
flagged? | Check if flagged |
flag_count | Number of flags |
flagged_at | When first flagged |
Model.all | Clean content (default) |
Model.with_flagged | Everything |
Model.flagged | Only flagged |
Model.not_flagged | Explicitly clean |