Installation
Add the gem, run the generator, migrate. The generator wires everything up; you point it at your auth controller.
Requirements
| Requirement | Version |
|---|---|
| Ruby | ≥ 3.2 |
| Rails (railties/activerecord) | ≥ 7.0 |
| Database | SQLite · MySQL · PostgreSQL |
Steps
# Gemfile
gem "rails-markup", require: "rails_markup"
bundle install
bin/rails generate rails_markup:install
bin/rails db:migrate
What the generator does
- Creates the annotations migration (adapter-aware
json/jsonb). - Writes
config/initializers/rails_markup.rb. - Generates
app/controllers/rails_markup_auth_controller.rb(your auth seam). - Mounts the engine in
config/routes.rb. - Injects the toolbar partial into your layout.
Generator options
| Option | Default | Purpose |
|---|---|---|
--mount-path |
/admin/annotations |
Where the dashboard mounts. |
--base-controller |
ApplicationController |
Parent controller (must enforce auth). |
--layout |
application |
Layout the toolbar is injected into. |
--table-name |
rails_markup_annotations |
DB table (kept in sync with config.table_name). |
bin/rails generate rails_markup:install \
--mount-path=/admin/feedback \
--base-controller=Admin::BaseController \
--table-name=feedback_annotations
Authentication is required. The dashboard and toolbar API inherit
config.base_controller_class. Point it at a controller that enforces admin auth — a public parent makes both interfaces public.
See Configuration next.
source: nauman/rails-markup · rev 1.2.1