-
Notifications
You must be signed in to change notification settings - Fork 359
Open
Description
inline: true on collection_ methods, at least for checkboxes and radio buttons, gives different CSS from a form with layout: :inline. The incorrect markup is even in the test case.
test "collection_check_boxes renders inline checkboxes correctly" do
collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")]
expected = <<~HTML
<input #{autocomplete_attr_55336} id="user_misc" name="user[misc][]" type="hidden" value="" />
<div class="mb-3">
<label class="form-label" for="user_misc">Misc</label> # FIXME: Form `layout: inline` gives "form-check form-check-inline ps-0"
<div class="form-check form-check-inline">
<input class="form-check-input" id="user_misc_1" name="user[misc][]" type="checkbox" value="1" />
<label class="form-check-label" for="user_misc_1">
Foo
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" id="user_misc_2" name="user[misc][]" type="checkbox" value="2" />
<label class="form-check-label" for="user_misc_2">
Bar
</label>
</div>
</div>
HTML
assert_equivalent_html expected, @builder.collection_check_boxes(:misc, collection, :id, :street,
inline: true)
endMetadata
Metadata
Assignees
Labels
No labels