class Primer::Alpha::CheckBox

end
end
end
end
AnotherPrimerForm.new(builder)
check_box.nested_form do |builder|
example_form.check_box(attributes) do |check_box|
form do |example_form|
class ExampleForm < ApplicationForm
@form_usage
desired, it must be done by hand.
NOTE: Check boxes do not automatically show or hide nested forms. If such behavior is
Any fields defined in the nested form are submitted along with the parent form’s fields.
of a Primer form (see the usage section below).
Define a nested form via the ‘#nested_form` method, which is expected to return an instance
to align with the label and caption.
is a form that is hidden until the check box is checked. Nested forms are indented slightly
Check boxes can have “nested” forms that are rendered below the caption. A common use-case
## Nested Forms
template named `foo_bar_caption.html.erb`.
check box. For example, a check box with the name `foo` and value `bar` must have a caption
array, caption template file names are comprised of both the name and the value of each
other input types. Because the name must be the same for all check boxes that make up an
Caption templates for `:array`-type check boxes work a little differently than they do for
## Caption templates
not checked, its value will not appear in the array.
check box is checked on submit, its corresponding value will appear in the array. If it is
`:value` argument must also be provided. The `:unchecked_value` argument is ignored. If a
same name and provide them to the controller as an array. If `:scheme:` is `:array`, the
same name. On form submission, Rails will aggregate the values of the check boxes with the
Whereas `:boolean` check boxes must have unique names, `:array` check boxes all have the
customized via the `:value` and `:unchecked_value` arguments respectively.
unchecked, a value of “0” is sent to the server. The checked and unchecked values can be
HTML check boxes. If they are checked, a value of “1” is sent to the server; if they are
or `:boolean` (the default). Check boxes with a scheme of `:boolean` function like normal
Check boxes can submit values to the server using one of two schemes, either `:array`
## Schemes
Check boxes are true/false inputs rendered as `<input type=“checkbox”>` in HTML.