Sha256: 4022b9e0958943ca285bd53b5f979dbaa83b0656c0a257d27d6e22783b1217dd
Contents?: true
Size: 587 Bytes
Versions: 27
Compression:
Stored size: 587 Bytes
Contents
# frozen_string_literal: true module UiBibzInputs class UiSwitchFieldInput < BaseInput include UiBibz::Ui::Core::Forms::Choices def input(_wrapper_options) UiBibz::Ui::Core::Forms::Choices::SwitchField.new(input_attribute_name, new_options, new_input_html_options).render end def new_input_html_options input_html_options.merge({ checked: value.nil? ? false : value }) end def value @value ||= @builder.object.send(attribute_name) end def new_options options.merge({ label: attribute_name.to_s.titleize }) end end end
Version data entries
27 entries across 27 versions & 1 rubygems