Installation

LesliBell provides account-scoped notifications and announcements. It requires Lesli ~> 5.1.0 and uses the host application's users, roles, accounts, and database.

Install the Engine

bundle add lesli_bell

The standard Lesli router mounts the engine at /bell:

Rails.application.routes.draw do
  Lesli::Router.mount(self)
end

For a manual mount:

Rails.application.routes.draw do
  mount LesliBell::Engine => "/bell"
end

Prepare the database and initialize existing accounts:

bin/rails lesli:db:prepare

This command adds LesliBell's migrations to the host application, prepares the database, and initializes the engine record used by each existing Lesli account. Run it again after adding LesliBell to an established application.

Verify the Installation

bin/rails routes -g bell
bin/rails server

Visit http://127.0.0.1:3000/bell. The current route surface is:

Method Path Purpose
GET /bell Shared LesliBell dashboard
GET /bell/notifications Current user's unread notification feed
GET /bell/notifications/new Reserved notification creation page
PUT/PATCH /bell/notifications/:id Mark one notification as read
GET/POST /bell/announcements List or create announcements
GET /bell/announcements/new Announcement creation form
GET/PATCH/PUT/DELETE /bell/announcements/:id Show, update, or soft-delete an announcement
GET /bell/announcements/:id/edit Announcement edit form
POST /bell/announcements/:id/dismiss Dismiss for the current user

Lesli's shared engine routes also provide dashboard editing and reusable item endpoints. Treat the output of bin/rails routes -g bell as the authoritative route list for the installed versions.

Development Data

LesliBell loads sample notifications and announcements only in development or when Lesli.config.demo is enabled:

bin/rails lesli:db:seed

The seeders require at least one Lesli account and user. They are intended for disposable development or demo environments.

Announcement samples use AnnouncementService#create with the first user's account and a general audience. Repeated runs skip names already present in that account, including soft-deleted announcements, preserving edits, publication state, and dismissals. Validation failures raise an error instead of silently producing incomplete demo data. This repeatability guarantee applies to announcement samples, not the separate notification seeder.

See Notifications, Announcements, Database, Translations, and Frontend for integration details.

 Edit this page

Last Update: 2026/11/14