Sha256: 7c15f79fa58207c09b6c2cdf1ce4a08d1b1b7ccb0427a91c42939304d686a355
Contents?: true
Size: 824 Bytes
Versions: 57
Compression:
Stored size: 824 Bytes
Contents
# frozen_string_literal: true module UiBibzInputs class UiChoiceGroupInput < CollectionInput include UiBibz::Ui::Core::Forms::Choices def input(wrapper_options = nil) label_method, value_method = detect_collection_methods # rubocop:disable Lint/UselessAssignment merged_input_options = merge_wrapper_options(input_html_options, wrapper_options) # rubocop:disable Lint/UselessAssignment UiBibz::Ui::Core::Forms::Choices::ChoiceGroup.new(input_options).tap do |bc| collection.each do |item| opts = { name: "#{@builder.object.class.name.underscore}[#{attribute_name}]", value: item[1] } opts = opts.merge({ state: :active }) if @builder.object.send(attribute_name).to_s == item[1].to_s bc.button item[0], opts end end.render end end end
Version data entries
57 entries across 57 versions & 1 rubygems