Sha256: a4d13b819422669a7b6758578ed260261b53f9cfeb824f90d21ad5dda90a876d

Contents?: true

Size: 534 Bytes

Versions: 16

Compression:

Stored size: 534 Bytes

Contents

module Formstrap
  module Labelable
    extend ActiveSupport::Concern
    included do
      def label?
        label != false
      end

      def prepend_label?
        label != false && !float
      end

      def append_label?
        label != false && float
      end

      def label_input_group_options
        float ? {bypass: true} : {}
      end

      def label_options
        {
          attribute: attribute,
          form: form,
          required: required,
          text: label
        }
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
formstrap-0.4.5 app/models/concerns/formstrap/labelable.rb
formstrap-0.4.4 app/models/concerns/formstrap/labelable.rb
formstrap-0.4.3 app/models/concerns/formstrap/labelable.rb
formstrap-0.4.2 app/models/concerns/formstrap/labelable.rb
formstrap-0.3.5 app/models/concerns/formstrap/labelable.rb
formstrap-0.3.4 app/models/concerns/formstrap/labelable.rb
formstrap-0.3.3 app/models/concerns/formstrap/labelable.rb
formstrap-0.3.2 app/models/concerns/formstrap/labelable.rb
formstrap-0.3.1 app/models/concerns/formstrap/labelable.rb
formstrap-0.3.0 app/models/concerns/formstrap/labelable.rb
formstrap-0.2.1 app/models/concerns/formstrap/labelable.rb
formstrap-0.2.0 app/models/concerns/formstrap/labelable.rb
formstrap-0.1.3 app/models/concerns/formstrap/labelable.rb
formstrap-0.1.2 app/models/concerns/formstrap/labelable.rb
formstrap-0.1.1 app/models/concerns/formstrap/labelable.rb
formstrap-0.1.0 app/models/concerns/formstrap/labelable.rb