Sha256: b65fcc3985296452a4c12b417d45fd6fbad2a52b8272628468035d1abf4f1f5d

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

module BulmaFormBuilder
  module Inputs
    module Select
      extend ActiveSupport::Concern

      include Base

      included do
        def select_with_bulma(method, choices = nil, options = {}, html_options = {}, &block)
          html_options[:required] = options[:required]

          div_class = ['select']
          div_class.push('is-fullwidth') if options.delete(:fullwidth)
          form_field_builder(method, options, html_options) do
            content_tag(:div, class: div_class.join(' ')) do
              select_without_bulma(method, choices, options, html_options, &block)
            end
          end
        end

        bulma_alias(:select)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bulma_form_builder-0.4.2 lib/bulma_form_builder/inputs/select.rb
bulma_form_builder-0.4.1 lib/bulma_form_builder/inputs/select.rb