Sha256: a945155ab56789dc57dd12a3f95aaed4c7819c24d735d6dab7e433976a7d5391

Contents?: true

Size: 386 Bytes

Versions: 16

Compression:

Stored size: 386 Bytes

Contents

module Formstrap
  module Listable
    extend ActiveSupport::Concern

    included do
      def list
        datalist_id if @list
      end

      def datalist?
        @list.present?
      end

      def datalist_options
        {
          collection: @list,
          id: datalist_id
        }
      end

      def datalist_id
        "#{attribute}_list"
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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