Class: EasyAdmin::ShowLayoutComponent

Inherits:
Phlex::HTML
  • Object
show all
Includes:
FieldsHelper
Defined in:
app/components/easy_admin/show_layout_component.rb

Instance Method Summary collapse

Methods included from FieldsHelper

#field_component, #render_field

Constructor Details

#initialize(resource_class:, record:) ⇒ ShowLayoutComponent

Returns a new instance of ShowLayoutComponent.



7
8
9
10
# File 'app/components/easy_admin/show_layout_component.rb', line 7

def initialize(resource_class:, record:)
  @resource_class = resource_class
  @record = record
end

Instance Method Details

#view_templateObject



12
13
14
15
16
17
18
# File 'app/components/easy_admin/show_layout_component.rb', line 12

def view_template
  if @resource_class.has_custom_show_layout?
    render_custom_layout
  else
    render_default_layout
  end
end