You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add radio, checkbox collections, unique DOM ids, select improvements,
and preview server to unreleased changelog. Update README field guide
with unique id examples and label association patterns.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,16 @@
1
1
## [Unreleased]
2
2
3
+
### Added
4
+
5
+
-**Radio component** with `field(:gender).radio("male")` API. Automatically handles name, value, and checked state. Each radio gets a unique DOM id based on its value (e.g. `user_gender_male`).
6
+
-**Checkbox collection support** — three modes:
7
+
-**Boolean** (on/off toggle): `Field(:featured).checkbox` renders with hidden "0" input
8
+
-**All-options** (pick from known set): `Field(:role_ids).checkbox(value: role.id)` with `[]` name and unique ids per value
9
+
-**Field collection** (from existing array): `field(:role_ids).collection { |r| r.checkbox }` for values already on the model
10
+
-**Unique DOM ids** for radio and checkbox groups via `DOM#id(*suffixes)`. Prevents duplicate ids in valid HTML and allows labels to target individual inputs.
11
+
-**Select improvements**: blank options (`nil`) at any position, `multiple: true` support with hidden input for empty submissions, ActiveRecord relations as options.
12
+
-**Preview server** — run `bin/preview` to view example forms at localhost:3000 with hot-reloading.
13
+
3
14
### Changed
4
15
5
16
-**Deprecation**: Components now accept HTML attributes as keyword arguments directly instead of wrapping them in `attributes:`. The old `attributes:` keyword still works but emits a deprecation warning and will be removed in a future version.
0 commit comments