Skip to content

Generated field ids include brackets, etc. #3811

@myabc

Description

@myabc

To reproduce:

<%=
  render(
    Primer::Alpha::CheckBox.new(
      scheme: :array,
      name: "permissions[#{role.id}]",
      value: "foo",
      checked: true,
      label: "Foo"
    )
  )
%>

Expected value

<div class="FormControl-checkbox-wrap">
  <input class="FormControl-checkbox" type="checkbox" value="foo" checked="checked" name="permissions[3][]" id="permissions[3]_foo">
  <span class="FormControl-checkbox-labelWrap">
    <label class="sr-only FormControl-label" for="permissions[3]_foo">
      Foo
    </label>      
  </span>
</div>

Actual value

<div class="FormControl-checkbox-wrap">
  <input class="FormControl-checkbox" type="checkbox" value="foo" checked="checked" name="permissions[3][]" id="permissions_3_foo">
  <span class="FormControl-checkbox-labelWrap">
    <label class="sr-only FormControl-label" for="permissions_3_foo">
      Foo
    </label>      
  </span>
</div>

more details will be added soon

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions