Class: EasyAdmin::Layouts::Builders::IndexLayoutBuilder

Inherits:
BaseLayoutBuilder show all
Defined in:
lib/easy_admin/layouts/builders/index_layout_builder.rb

Overview

IndexLayoutBuilder for constructing index page layouts Specialized builder for index table field configurations

Instance Attribute Summary

Attributes inherited from BaseLayoutBuilder

#current_container_stack, #resource_class, #root_node

Instance Method Summary collapse

Methods inherited from BaseLayoutBuilder

#add_node, #belongs_to_field, #boolean_field, #build, #content, #current_container, #date_field, #datetime_field, #divider, #email_field, #fields, #file_field, #grid, #has_many_field, #id_field, #json_field, #method_missing, #number_field, #password_field, #render, #respond_to_missing?, #section, #select_field, #spacer, #tabs, #text_field, #textarea_field, #with_container

Constructor Details

#initialize(resource_class: nil) ⇒ IndexLayoutBuilder

Returns a new instance of IndexLayoutBuilder.



7
8
9
# File 'lib/easy_admin/layouts/builders/index_layout_builder.rb', line 7

def initialize(resource_class: nil)
  super(:index, resource_class: resource_class)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EasyAdmin::Layouts::Builders::BaseLayoutBuilder

Instance Method Details

#field(name, **options) ⇒ Object

Simple field method for index - only accepts field name Configuration is extracted from already registered resource fields



13
14
15
16
17
18
# File 'lib/easy_admin/layouts/builders/index_layout_builder.rb', line 13

def field(name, **options)
  # Create a simple field node with just the name
  # The actual field configuration will be looked up from resource fields_config
  field_node = Nodes::FieldNode.new(name, options)
  add_node(field_node)
end