Sha256: a635d730f930e9e367f7a95f484f261b734d7f0766331e1294fbf8a29e23d358
Contents?: true
Size: 611 Bytes
Versions: 53
Compression:
Stored size: 611 Bytes
Contents
# frozen_string_literal: true module UiBibzInputs class UiChoiceFieldInput < CollectionInput include UiBibz::Ui::Core::Forms::Choices def input(_wrapper_options) UiBibz::Ui::Core::Forms::Choices::Choice.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: options[:old_label] || attribute_name.to_s.titleize }) end end end
Version data entries
53 entries across 53 versions & 1 rubygems