Sha256: c9b84606364d50e6c64a18b5e92f3da9c57d2e154319b5467942e5855cc9bf61

Contents?: true

Size: 645 Bytes

Versions: 64

Compression:

Stored size: 645 Bytes

Contents

module BootstrapForm
  module CheckBoxPatch

    # TODO: check upstream - it is on master on 29-1-2018 - only required is not there
    def check_box(name, options = {}, checked_value = "1", unchecked_value = "0", &block)
      options = options.symbolize_keys!
      check_box_options = options.except(:label, :label_class, :wrapper_class, :help, :inline)

      label_classes = [options[:label_class], 'form-check-label']
      unless options.delete(:skip_required)
        label_classes << "required" if required_attribute?(object, name)
      end
      options[:label_class] = label_classes.compact.join(' ')

      super
    end

  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha16 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha15 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha14 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha13 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha12 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha11 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha10 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha9 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha8 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha7 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha6 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha5 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha4 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.4.5 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.4.4 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha3 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha2 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.5.0.alpha1 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.4.3 lib/bootstrap_form/check_box_patch.rb
egov_utils-1.4.2 lib/bootstrap_form/check_box_patch.rb