oop-presenters
Installation
SKILL.md
Presenters
What it is
A Presenter (sometimes called a Decorator or View Object) wraps a model and adds display-only logic: formatted strings, conditional CSS classes, labels for enum values, HTML-safe output. It lives in the view layer and keeps the model clean.
Presenters are a better home for display logic than:
- Fat view helpers (hard to discover, no OO)
- Model methods like
formatted_created_at(models shouldn't know about display) - ERB conditionals repeated across multiple views
Would a fat model / helper do?
Use a helper if the formatting is generic and reused across many different models (e.g. time_ago_in_words). Keep it on the model if it's about domain state, not display. Extract a presenter when:
- A model has 3+ display-only methods (formatted dates, label strings, CSS classes)
- The same model is displayed differently in different contexts (list vs. detail view)
- Your helper module for one model is growing past 20 lines