Sha256: 2992166daf2a8458442711123a247ef56a0fb2e9916532c50b82fe71eaeeeb06

Contents?: true

Size: 712 Bytes

Versions: 10

Compression:

Stored size: 712 Bytes

Contents

module BulmaFormBuilder
  module Inputs
    module MonthField
      extend ActiveSupport::Concern

      include Base

      included do
        def month_field_with_bulma(name, options = {})
          form_field_builder(name, options) do
            classes = [options[:class]]
            classes <<= 'input'
            classes <<= 'is-danger' if error?(name)
            options[:class] = classes.compact.join(' ')

            # NOTE: month_fieldの場合だけこれがないと初期値が入らないので
            options[:value] = object.public_send(name)

            month_field_without_bulma(name, options)
          end
        end

        bulma_alias :month_field
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bulma_form_builder-0.4.3 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.4.2 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.4.1 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.4.0 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.3.1 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.3.0 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.2.1 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.2.0 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.1.1 lib/bulma_form_builder/inputs/month_field.rb
bulma_form_builder-0.1.0 lib/bulma_form_builder/inputs/month_field.rb