Class: Administrate::Page::Collection

Inherits:
Base
  • Object
show all
Defined in:
lib/administrate/page/collection.rb

Instance Method Summary collapse

Methods inherited from Base

#association_includes, #initialize, #resource_name, #resource_path

Constructor Details

This class inherits a constructor from Administrate::Page::Base

Instance Method Details

#attribute_namesObject



6
7
8
# File 'lib/administrate/page/collection.rb', line 6

def attribute_names
  dashboard.collection_attributes
end

#attribute_typesObject



16
17
18
# File 'lib/administrate/page/collection.rb', line 16

def attribute_types
  dashboard.attribute_types_for(attribute_names)
end

#attributes_for(resource) ⇒ Object



10
11
12
13
14
# File 'lib/administrate/page/collection.rb', line 10

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

#order_params_for(attr, key: resource_name) ⇒ Object



26
27
28
# File 'lib/administrate/page/collection.rb', line 26

def order_params_for(attr, key: resource_name)
  { key => order.order_params_for(attr) }
end

#ordered_html_class(attr) ⇒ Object



20
21
22
# File 'lib/administrate/page/collection.rb', line 20

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