class UiBibz::Ui::Core::Forms::Choices::SwitchField

Create a SurroundField

This element is an extend of UiBibz::Ui::Core::Component. Source : www.bootstrap-switch.org/documentation-2.html

Attributes

Options

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

Signatures

UiBibz::Ui::Core::Forms::SwithField.new(content, options = {}, html_options = {}).render

UiBibz::Ui::Core::Forms::SwithField.new(options = {}, html_options = {}) do
  content
end.render

Examples

ui_switch_field 'name', checked: true

Helper

ui_switch_field(options = {}, html_options = {}) do
 # content
end

Private Instance Methods

component_options() click to toggle source
# File lib/ui_bibz/ui/core/forms/choices/switch_field.rb, line 46
def component_options
  { boolean: true }
end
wrapper_classes() click to toggle source
# File lib/ui_bibz/ui/core/forms/choices/switch_field.rb, line 50
def wrapper_classes
  %w[form-check form-switch]
end