Class: UiBibzInputs::UiBoxSwitchFieldInput

Inherits:
BaseInput
  • Object
show all
Includes:
UiBibz::Ui::Core::Forms::Choices
Defined in:
lib/ui_bibz/inputs/ui_bibz_inputs/ui_box_switch_field_input.rb

Instance Method Summary collapse

Methods inherited from BaseInput

#options

Instance Method Details

#input(_wrapper_options) ⇒ Object



7
8
9
# File 'lib/ui_bibz/inputs/ui_bibz_inputs/ui_box_switch_field_input.rb', line 7

def input(_wrapper_options)
  UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new(input_attribute_name, options, new_input_html_options).render
end

#new_input_html_optionsObject



11
12
13
# File 'lib/ui_bibz/inputs/ui_bibz_inputs/ui_box_switch_field_input.rb', line 11

def new_input_html_options
  input_html_options.merge({ checked: value.nil? ? false : value })
end

#valueObject



15
16
17
# File 'lib/ui_bibz/inputs/ui_bibz_inputs/ui_box_switch_field_input.rb', line 15

def value
  @value ||= @builder.object.send(attribute_name)
end