File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ class SignupForm < Components::Form
412412 fieldset do
413413 legend { " Roles" }
414414 Role .all.each do |role |
415- label(for: " #{ field(:role_ids ).dom.id } _ #{ role.id } " ) do
415+ label(for: field(:role_ids ).dom.id( role.id) ) do
416416 Field (:role_ids ).checkbox(value: role.id)
417417 whitespace
418418 plain role.name
@@ -426,7 +426,7 @@ class SignupForm < Components::Form
426426 fieldset do
427427 legend { " Plan" }
428428 Plan .all.each do |plan |
429- label(for: " #{ field(:plan_id ).dom.id } _ #{ plan.id } " ) do
429+ label(for: field(:plan_id ).dom.id( plan.id) ) do
430430 Field (:plan_id ).radio(plan.id)
431431 whitespace
432432 plain plan.name
Original file line number Diff line number Diff line change @@ -72,5 +72,11 @@ def build_lineage(**lineage)
7272
7373 expect ( field . dom . id ) . to eq ( "grandparent_bars_baz" )
7474 end
75+
76+ it "appends suffixes to the id" do
77+ field = build_lineage ( parent : Superform ::Namespace , child : Superform ::Field )
78+ expect ( field . dom . id ( "male" ) ) . to eq ( "parent_child_male" )
79+ expect ( field . dom . id ( 1 ) ) . to eq ( "parent_child_1" )
80+ end
7581 end
7682end
You can’t perform that action at this time.
0 commit comments