rails-presenter

Generate Rails presenter objects with SimpleDelegator for view-specific formatting.

1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/LaunchPadLab/ai-bank --skill rails-presenter-launchpadlab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-presenter
Source: https://github.com/LaunchPadLab/ai-bank/tree/main/claude/skills/rails-presenter
Command: npx skills add https://github.com/LaunchPadLab/ai-bank --skill rails-presenter-launchpadlab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you extract Rails view formatting logic out of models and controllers, replacing ad-hoc helpers with clean Presenter objects that are tested first.

Core Features & Use Cases

  • SimpleDelegator-based presenters: Wrap models with a delegate layer so views call presentation methods while the underlying model remains focused on data.
  • View formatting utilities: Produce display-ready outputs like HTML-safe status badges, formatted dates, and currency strings (including nil fallbacks).
  • TDD workflow for presenters: Start with failing tests in test/presenters/, implement presenters extending BasePresenter, and iterate until GREEN.

Example use case: you need consistent formatting for a resource page that shows a localized date, an Active/Inactive badge, and euro amounts stored as cents.

Quick Start

Use the rails-presenter skill to turn your model’s display concerns into a tested presenter for the view.

Frequently Asked Questions about rails-presenter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What's the best way to extract view formatting logic from Rails models and controllers?

Rails presenters using the SimpleDelegator pattern wrap models to provide view-specific formatting like HTML-safe badges and localized dates, keeping underlying models focused on data. This replaces ad-hoc helpers with clean, tested presentation objects.

How do I test Rails presenter objects using a TDD workflow?

Start the TDD workflow for Rails presenters by writing failing tests in test/presenters/, then implement presenter classes extending BasePresenter, and iterate until tests pass. This ensures view formatting logic like currency formatting and nil-safe helpers is validated before integration.

How does SimpleDelegator work for creating presenters in Rails?

SimpleDelegator-based presenters wrap a model with a delegation layer so views call presentation methods while automatically forwarding unknown methods to the underlying model. This keeps model code data-focused and isolates display concerns like status badges and date formatting.

Can I use Rails presenters for nil-safe display helpers and I18n formatting?

Rails presenters support nil-safe display helpers with fallback outputs and integrate I18n for localized formatting. They produce display-ready HTML-safe badges, formatted dates, and currency strings stored as cents, ensuring consistent UI rendering across resource pages.

When should I use a presenter instead of Rails helpers for view formatting?

Use Rails presenters instead of helpers when formatting logic becomes complex, requires testing, or wraps model-specific display concerns like Active/Inactive badges and euro amounts. Presenters extracted via SimpleDelegator provide a structured, testable alternative to scattered helper methods.

Does the Rails presenter pattern require ActionView helpers and a BasePresenter convention?

The Rails presenter pattern uses conventions including extending a BasePresenter class and incorporating ActionView helpers for view output. Presenters follow SimpleDelegator delegation to wrap models while providing tested, HTML-safe formatting methods for the view layer.