Presenters and Decorators: A Code Tour
summary
Shows a real failure case where a custom component system hides rendering behind metaprogramming, forcing a new hire to trace builders and HAML partials; replaces that hairball with concrete presenters like an AuthorSummary object and focused serializers that implement to_json, compares Draper, template approaches (Rabl/Jbuilder) and active model serializers, and builds a homepage composed of small presenters so templates become dumb, unit tests run fast and behavior is verifiable, while warning that presenters add overhead and are presenter spectrum tools used only when pain justifies them.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 2:14When to use presenters in Rails
- 12:29Cost of advanced view patterns
- 14:34Presenter use cases
- 23:11Serialization with presenters
- 29:50Beyond serialization
- 33:20Presenters vs decorators vs mediators
- 36:10Simplifying view logic
- 40:22Real-world presenter example
- 45:18When presenters are worth it
- 46:43Q&A








