New on the blog: Form Helpers in Wheels 4.0 — Obje...
# wheels-dev
p
New on the blog: Form Helpers in Wheels 4.0 — Object Forms, HTML5 Fields, and Error Rendering. <https://blog.wheels.dev/posts/form-helpers-objects-and-html5/ > What it covers: • The one mental model —
objectName
is the variable name (a string), not the object.
textField(objectName="user", property="email")
emits
name="user[email]"
and round-trips into
params.user.email
. • The real HTML5 single-input roster — emailField, urlField, numberField, telField, dateField, colorField, rangeField, searchField (+ textField with a type override). No timeField/dateTimeField/monthField/weekField exist. •
method="put"
isn't real HTTP — startFormTag rewrites to POST + a hidden
_method
field, and auto-appends the CSRF token for non-GET. • The unchecked-checkbox problem and how
uncheckedValue
(on by default, with the
($checkbox)
companion) keeps the param from vanishing. •
*Tag
helpers (flat params, for search/login/filters) vs object helpers (nested params). • errorMessagesFor (a
<ul>
of everything) vs errorMessageOn (first message, inline). • There's no standalone label() helper — labels come from the
label=
arg, and the input nests inside the label by default. A worked, end-to-end create/edit form, plus a Sharp Edges section built from the behaviors that bite first.