~/talk

Decouple Your Models with Form Objects

Talkat RailsConf 2017 · 2017-04-25..04-27· [ruby-on-rails, frontend-architecture]
slides:none on file

Builds a three-step onboarding wizard for dog-walking companies and shows that form objects remove model cruft: validations live on forms, not in fat models, and nested attributes and conditional state machines disappear. Uses plain Ruby form objects with activemodel::model then refactors to use the Reform gem (Trailblazer) to get prepopulate/populator behavior, collections, and composition. Saves each step transactionally, keeps controllers RESTful, makes tests fast, and reduces boilerplate compared side‑by‑side with a hand‑rolled solution.

AI-written summary · about

  1. 0:00Start
  2. 12:41initializing the nested fill method
  3. 13:06define the properties inside the collection
  4. 14:36add a pre-populated method to the collection
  5. 17:32adding and removing addresses
  6. 20:15add or remove multiple addresses
  7. 23:31testing the form objects
~/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.