~/talk

Properly Factored MVC in Rails Applications

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

A real refactor of a large Rails app: the stats controller is ~800 lines and one index action is ~200 lines with ~35 instance variables, so code is extracted into a new TagCloud model with a compute method, behavior preserved by a lockdown characterization test that captures raw HTML, tests guarded with Timecop to freeze time, SimpleCov and focused rake tasks (full suite ~17 minutes). Iterative extraction, renaming, and removing duplication shrink the controller while keeping output identical.

AI-written summary · about

  1. 0:00Start
  2. 6:58Data Get from a Controller to a View
  3. 8:28Controller
  4. 10:15Refactoring
  5. 29:18Lockdown Test
  6. 48:43Recap
  7. 55:44Isolating the Code
  8. 1:00:26Embed Classes within Other Classes
  9. 1:40:33Heroku Performance Workshop
~/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.