Sha256: f10a7ecfa039f6cabc1e56057457b3b9730dd723f612b38fe74368d618fecd6b

Contents?: true

Size: 676 Bytes

Versions: 19

Compression:

Stored size: 676 Bytes

Contents

require_relative "base"

module Administrate
  module Page
    class Collection < Page::Base
      def attribute_names
        dashboard.collection_attributes
      end

      def attributes_for(resource)
        attribute_names.map do |attr_name|
          attribute_field(dashboard, resource, attr_name, :index)
        end
      end

      def attribute_types
        dashboard.attribute_types_for(attribute_names)
      end

      def ordered_html_class(attr)
        ordered_by?(attr) && order.direction
      end

      delegate :ordered_by?, :order_params_for, to: :order

      private

      def order
        options[:order] || Order.new
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
administrate-0.10.0 lib/administrate/page/collection.rb
semantic-administrate-0.1.1 lib/administrate/page/collection.rb
administrate-0.9.0 lib/administrate/page/collection.rb
semantic-administrate-0.1.0 lib/administrate/page/collection.rb
administrate-0.8.1 lib/administrate/page/collection.rb
administrate-0.8.0 lib/administrate/page/collection.rb
administrate-0.7.0 lib/administrate/page/collection.rb
administrate-0.6.0 lib/administrate/page/collection.rb
administrate-0.5.0 lib/administrate/page/collection.rb
administrate-0.4.0 lib/administrate/page/collection.rb
administrate-0.3.0 lib/administrate/page/collection.rb
administrate-0.2.2 lib/administrate/page/collection.rb
administrate-0.2.1 lib/administrate/page/collection.rb
administrate-0.2.0 lib/administrate/page/collection.rb
administrate-0.2.0.rc1 lib/administrate/page/collection.rb
administrate-0.1.5 lib/administrate/page/collection.rb
administrate-0.1.4 lib/administrate/page/collection.rb
administrate-0.1.3 lib/administrate/page/collection.rb
administrate-0.1.2 lib/administrate/page/collection.rb