Class: UiBibzInputs::UiCheckboxFieldInput
Instance Method Summary
collapse
Methods inherited from BaseInput
#options
Instance Method Details
11
12
13
|
# File 'lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb', line 11
def input(_wrapper_options)
UiBibz::Ui::Core::Forms::Choices::CheckboxField.new(input_attribute_name, new_options, new_input_html_options).render
end
|
#label(_wrapper_options) ⇒ Object
7
8
9
|
# File 'lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb', line 7
def label(_wrapper_options)
false
end
|
15
16
17
|
# File 'lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb', line 15
def new_input_html_options
input_html_options.merge({ checked: value.nil? ? false : value })
end
|
#new_options ⇒ Object
23
24
25
|
# File 'lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb', line 23
def new_options
options.merge({ label: options[:label] || attribute_name.to_s.titleize })
end
|
#value ⇒ Object
19
20
21
|
# File 'lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb', line 19
def value
@value ||= @builder.object.send(attribute_name)
end
|