Class: RailsAdmin::Config::Sections::List

Inherits:
Base
  • Object
show all
Includes:
HasFields
Defined in:
lib/rails_admin/config/sections/list.rb

Overview

Configuration of the list view

Instance Attribute Summary

Attributes inherited from Base

#abstract_model, #bindings, #parent, #root

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasFields

#exclude_fields, #field, #fields, #fields_of_type, #include_all_fields, #include_fields, #visible_fields

Methods inherited from Base

#has_option?, register_class_option, #register_deprecated_instance_option, register_deprecated_instance_option, register_instance_option, #register_instance_option, #with

Constructor Details

#initialize(parent) ⇒ List

Returns a new instance of List.



13
14
15
16
17
18
19
20
21
22
# File 'lib/rails_admin/config/sections/list.rb', line 13

def initialize(parent)
  super(parent)
  # Populate @fields instance variable with model's properties
  @fields = RailsAdmin::Config::Fields.factory(self)
  @fields.each do |f|
    if f.association? && !f.kind_of?(RailsAdmin::Config::Fields::Types::BelongsToAssociation)
      f.visible false
    end
  end
end

Class Method Details

.default_items_per_pageObject



24
25
26
27
# File 'lib/rails_admin/config/sections/list.rb', line 24

def self.default_items_per_page
  ActiveSupport::Deprecation.warn("'#{self.name}.default_items_per_page' is deprecated, use 'RailsAdmin::Config.default_items_per_page' instead", caller)
  RailsAdmin::Config.default_items_per_page
end

.default_items_per_page=(value) ⇒ Object



29
30
31
32
33
34
# File 'lib/rails_admin/config/sections/list.rb', line 29

def self.default_items_per_page=(value)
  ActiveSupport::Deprecation.warn("'#{self.name}.default_items_per_page=' is deprecated, use 'RailsAdmin.config{|c| c.default_items_per_page = #{value}}' instead", caller)
  RailsAdmin.config do |config|
    config.default_items_per_page = value
  end
end