~/talk

Curly — Rethinking the View Layer

Talkat RailsConf 2015 · 2015-04-21..04-23· [ruby-on-rails, frontend-architecture]
slides:none on file

A Rails-friendly template engine called Curly templates extracts all view logic into plain Ruby presenter classes placed in app presenters, keeps HTML purely declarative, and lets customized templates live in the database while reusing the same presenter. Caching uses a simple cache_key method on presenters; testing calls presenter methods directly. It ships in production for about 2.5 years, stops Javascript-based DOM hacks, reduces breakage across tens of thousands of customers, and integrates with ERB/Haml rather than replacing them.

AI-written summary · about

  1. 0:00Intro
  2. 0:42No JavaScript!
  3. 1:36Curly Rethinking the view layer
  4. 2:09How we came to build a new template language
  5. 2:42Help Center Hosted knowledge Base & Community that integrates with Zendesk
  6. 5:46Theming & customizable templates
  7. 8:21Customers should write templates, not code
  8. 15:24Customers' templates stored in the database
  9. 15:54Safe and simple for our customers to use
  10. 19:03Separation of structure & logic (!!)
  11. 20:48Render view with a bunch of variables set • Parse the result
  12. 22:36Test the logic with unit tests
  13. 24:12Use the best tool for the job Markup languages for structure Programming languages for logic
  14. 25:36Action Controller Rendered HTML Action View Ruby code (string) Template Handler
  15. 27:45So, is Curly better than ERb?
  16. 29:36Running in production for 2 years
  17. 29:49gem install curly-templates
~/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.