Sha256: 5a667ca2dea48817eb5ea0743cbeb8a6ed269204f4fd62b8277a656818c1d659

Contents?: true

Size: 908 Bytes

Versions: 1

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true

module BootstrapForm
  module Inputs
    module CollectionSelect
      extend ActiveSupport::Concern
      include Base

      included do
        # Disabling Metrics/ParameterLists because the upstream Rails method has the same parameters
        # rubocop:disable Metrics/ParameterLists
        def collection_select_with_bootstrap(method, collection, value_method, text_method, options={}, html_options={})
          html_options = html_options.reverse_merge(control_class: "form-select")
          form_group_builder(method, options, html_options) do
            input_with_error(method) do
              collection_select_without_bootstrap(method, collection, value_method, text_method, options, html_options)
            end
          end
        end
        # rubocop:enable Metrics/ParameterLists

        bootstrap_alias :collection_select
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootstrap_form-5.0.0 lib/bootstrap_form/inputs/collection_select.rb