~/talk

All you need to know to build Dynamic Forms (JS FREE)

Talkat RailsConf 2021 · 2021-04-12..04-15· [ruby-on-rails]
slides:none on file

Shows a concrete Rails implementation that renders DB-driven forms, validates and persists submissions (creates a Reference record), and supports repeatable fields without bespoke JS. Uses ActiveModel API on plain Ruby objects plus the Form Objects pattern to run validations and a save method, and swaps a fragile custom JS approach for Hotwire turbo streams to append/remove field fragments. Includes a small gem (yes) mention, uses SecureRandom UUIDs for transient repetitions, and it works in production.

AI-written summary · about

  1. 0:00Introduction
  2. 2:33Context
  3. 4:38Modelling the solution
  4. 6:32Lifecycle of a form
  5. 8:32Rendering the Dynamic Form
  6. 11:16ActiveModel API
  7. 14:05Using ActiveModel in a PORO
  8. 16:23Adding validations
  9. 17:17Submitting the form
  10. 18:29Form Objects Pattern
  11. 20:23Implementing save and save!
  12. 22:07Final boss: Repeatable fields
  13. 27:03Using Hotwire
~/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.