Sha256: f8b741980e805f305883df597cdea9da5a8adc299d8b87f724f170045cda8802

Contents?: true

Size: 736 Bytes

Versions: 5

Compression:

Stored size: 736 Bytes

Contents

# -*- encoding: utf-8 -*-
# -*- frozen_string_literal: true -*-
# -*- warn_indent: true -*-

module RailsBootstrapForm
  module Inputs
    module CollectionSelect
      extend ActiveSupport::Concern

      included do
        def collection_select(attribute, collection, value_method, text_method, options = {}, html_options = {})
          bootstrap = bootstrap_form_options.scoped(options.delete(:bootstrap))
          return super if bootstrap.disabled?

          bootstrap.set_field_class!("form-select")

          field_wrapper_builder(attribute, bootstrap, options, html_options) do
            super(attribute, collection, value_method, text_method, options, html_options)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_bootstrap_form-0.9.9 lib/rails_bootstrap_form/inputs/collection_select.rb
rails_bootstrap_form-0.9.8 lib/rails_bootstrap_form/inputs/collection_select.rb
rails_bootstrap_form-0.9.7 lib/rails_bootstrap_form/inputs/collection_select.rb
rails_bootstrap_form-0.9.6 lib/rails_bootstrap_form/inputs/collection_select.rb
rails_bootstrap_form-0.9.5 lib/rails_bootstrap_form/inputs/collection_select.rb