~/talk

Maintainable Templates

Talkat RailsConf 2013 · 2013-04-29..05-02· [ruby-on-rails, frontend-architecture]
links:none on file
slides:none on file

Templates stop being a mess when presentation logic moves into small, testable objects: use the masked credit card example to see a decorator hide formatting, adopt the decorator pattern or the draper gem for model-specific view behavior, extract UI-element logic into a story summary view object (presentation model) that renders itself, and replace repeated form markup with a custom form builder or gems like simple_form and tablecloth so changed HTML or labels updates once and actually fixes the maintenance pain.

AI-written summary · about

  1. 0:00Introduction
  2. 0:57Neglected templates in Rails
  3. 2:01Markup repetition with partials
  4. 3:25Logic dangers in templates
  5. 5:17Helpers for view logic
  6. 7:42Decorator pattern for views
  7. 11:32Draper gem
  8. 13:18Presentation models
  9. 18:31Clean templates with objects
  10. 20:15Custom form builders
  11. 21:23Internationalization tips
~/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.