Several of my personal projects —
sortirauresto.com,
planango.com,
voices.live, and
bookscovery.com —
needed a straightforward way to handle cookie consent. I looked for an existing gem
but couldn't find one that was both actively maintained and simple enough to drop in
without a lot of hassle. Most were either abandoned or brought more complexity than the problem warranted.
So I built one.
What it does
Renders a configurable consent banner (top or bottom of the page)
Manages consent state via a browser cookie — no database required
Stimulus controller for accept all, reject all, and manage preferences flows
Fully accessible — ARIA roles, labels, and keyboard navigation
i18n ready — English and French included, any locale easily added
Themeable via CSS custom properties — no stylesheet overrides needed
No build step — delivered as a plain ES module for Rails import maps
No dependencies beyond Rails itself
How it was built
The gem was written with Claude Code.
A full specification was written first and used to drive the implementation.
The spec is available in the
repository,
alongside the source code, tests, and documentation.