Module: Locomotive::Concerns::Page::Sections

Extended by:
ActiveSupport::Concern
Includes:
Shared::JsonAttribute
Included in:
Page
Defined in:
app/models/locomotive/concerns/page/sections.rb

Instance Method Summary collapse

Instance Method Details

#all_sections_contentObject



20
21
22
23
24
25
26
27
28
29
# File 'app/models/locomotive/concerns/page/sections.rb', line 20

def all_sections_content
  (self.sections_dropzone_content || []).map.each_with_index do |section, index|
    # based on the mechanism that Steam uses to generate the anchors
    _anchor = (section['anchor'] || "dropzone-#{index}") + '-section'
    section.merge({ 'anchor' => _anchor })
  end +
  (self.sections_content || {}).map do |(section_id, section)|
    section.merge({ 'anchor' => "page-#{section_id}-section" })
  end
end