Skip to content

Checkbox include_hidden for array values #2

@nolantait

Description

@nolantait

https://guides.rubyonrails.org/form_helpers.html#basic-structure

Array parameters do not play well with the check_box helper. According to the HTML specification unchecked checkboxes submit no value. However it is often convenient for a checkbox to always submit a value. The check_box helper fakes this by creating an auxiliary hidden input with the same name. If the checkbox is unchecked only the hidden input is submitted. If it is checked then both are submitted but the value submitted by the checkbox takes precedence. There is a include_hidden option that can be set to false if you want to omit this hidden field. By default, this option is true.

Needs to be supported in the checkbox component

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions