~/talk

Presenters and Decorators: A Code Tour

Talkat RailsConf 2012 · 2012-04-23..04-25· [ruby-on-rails, component-design]
slides:none on file

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

  1. 0:00Introduction
  2. 2:14When to use presenters in Rails
  3. 12:29Cost of advanced view patterns
  4. 14:34Presenter use cases
  5. 23:11Serialization with presenters
  6. 29:50Beyond serialization
  7. 33:20Presenters vs decorators vs mediators
  8. 36:10Simplifying view logic
  9. 40:22Real-world presenter example
  10. 45:18When presenters are worth it
  11. 46:43Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.