Sha256: ccefb60174949acc32faebfa4f338067132055d7abdd79163ee75655d5603c2f
Contents?: true
Size: 754 Bytes
Versions: 38
Compression:
Stored size: 754 Bytes
Contents
module UiBibzInputs class UiChoiceGroupInput < CollectionInput#::Inputs::CollectionRadioButtonsInput include UiBibz::Ui::Core::Forms::Choices def input(wrapper_options = nil) label_method, value_method = detect_collection_methods merged_input_options = merge_wrapper_options(input_html_options, wrapper_options) 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
38 entries across 38 versions & 1 rubygems