Method: Locomotive::Concerns::Page::Sections#all_sections_content

Defined in:
app/models/locomotive/concerns/page/sections.rb

#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