Sha256: 841a34d6fc226f816bcee127da49f18084eaa50a77da6ecbb13243b06eb849f9

Contents?: true

Size: 799 Bytes

Versions: 9

Compression:

Stored size: 799 Bytes

Contents

module Trestle
  class Form
    module Fields
      module RadioButtonHelpers
        def custom?
          options[:custom] != false
        end

        def inline?
          options[:inline]
        end

        def default_wrapper_class
          if custom?
            [
              "custom-control",
              "custom-radio",
              ("custom-control-inline" if inline?)
            ].compact
          else
            [
              "form-check",
              ("form-check-inline" if inline?)
          ].compact
          end
        end

        def input_class
          custom? ? ["custom-control-input"] : ["form-check-input"]
        end

        def label_class
          custom? ? ["custom-control-label"] : ["form-check-label"]
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trestle-0.9.8 lib/trestle/form/fields/radio_button_helpers.rb
trestle-0.9.7 lib/trestle/form/fields/radio_button_helpers.rb
trestle-0.9.6 lib/trestle/form/fields/radio_button_helpers.rb
trestle-0.9.5 lib/trestle/form/fields/radio_button_helpers.rb
trestle-0.9.4 lib/trestle/form/fields/radio_button_helpers.rb
trestle-0.9.3 lib/trestle/form/fields/radio_button_helpers.rb
trestle-0.9.2 lib/trestle/form/fields/radio_button_helpers.rb
trestle-0.9.1 lib/trestle/form/fields/radio_button_helpers.rb
trestle-0.9.0 lib/trestle/form/fields/radio_button_helpers.rb