Sha256: 5b44b0b62799116914075ceb0f2dd0aeacef99af19633d47555bb49e7e02757a

Contents?: true

Size: 602 Bytes

Versions: 17

Compression:

Stored size: 602 Bytes

Contents

module Headmin
  module Form
    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
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
headmin-0.6.3 app/models/concerns/headmin/form/labelable.rb
headmin-0.6.2 app/models/concerns/headmin/form/labelable.rb
headmin-0.6.1 app/models/concerns/headmin/form/labelable.rb
headmin-0.6.0 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.9 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.8 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.7 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.6 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.5 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.4 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.3 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.2 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.1 app/models/concerns/headmin/form/labelable.rb
headmin-0.5.0 app/models/concerns/headmin/form/labelable.rb
headmin-0.4.2 app/models/concerns/headmin/form/labelable.rb
headmin-0.4.1 app/models/concerns/headmin/form/labelable.rb
headmin-0.4.0 app/models/concerns/headmin/form/labelable.rb