Phlex form builder
Forms that already know your model
phlex-forms renders label, input, and error in one field call — type, requiredness, and choices inferred from the model. Declare forms as Phlex classes, theme them daisyUI or plain, and validate live against the real validators.
gem "phlex-forms"field :notify renders a toggle for a boolean column, an enum becomes a humanized select, a belongs_to a collection select — as:/choices: are overrides, not requirements.
Subclass Forms::Base and declare fields where self IS the form — reusable, testable form objects with inherited defaults, no f. prefix on every line.
live model: User runs your REAL validators on blur — uniqueness, :if/:unless, confirmation — and morphs errors back with focus preserved, via phlex-reactive.
Variants stack positionally (field :email, :primary, :sm) with form-level defaults; swap the theme and the same form class renders bare semantic HTML in a non-daisyUI project.
No phlex-reactive? validate: true mirrors your ActiveModel validators into shipped Stimulus controllers — presence, length counters, format, confirmation, and more.
Rails-parity helpers (fields_for, collection_check_boxes), unscoped and JSONB modes for dynamic rows, and RuboCop cops that autocorrect legacy form calls.