Class: Arclight::MetadataSectionComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/arclight/metadata_section_component.rb

Overview

Render a simple metadata field (e.g. without labels) in a .row div

Instance Method Summary collapse

Constructor Details

#initialize(section:, presenter:, metadata_attr: {}, classes: %w[row dl-invert],, heading: false) ⇒ MetadataSectionComponent

Returns a new instance of MetadataSectionComponent.



8
9
10
11
12
13
14
15
16
# File 'app/components/arclight/metadata_section_component.rb', line 8

def initialize(section:, presenter:, metadata_attr: {}, classes: %w[row dl-invert], heading: false)
  super

  @classes = classes
  @section = section
  @presenter = presenter.with_field_group(section)
  @heading = heading
  @metadata_attr = 
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/components/arclight/metadata_section_component.rb', line 18

def render?
  @presenter.fields_to_render.any?
end