Class: Page::LayoutComponent

Inherits:
SparkComponents::Component
  • Object
show all
Defined in:
app/components/spark/page/layout_component.rb

Instance Method Summary collapse

Instance Method Details



29
30
31
# File 'app/components/spark/page/layout_component.rb', line 29

def modal(&block)
  content_for(:modals, &block)
end

#renderObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/components/spark/page/layout_component.rb', line 11

def render
  @view.capture do
    if title || nav || header
      concat (:div, class: join_class("header")) {
        concat (:div, nav, join_class: "header-nav")
        concat(component("layout/header", title: title) { |h|
          actions.each { |a| h.action { a.yield }}
        })
        concat (:div, header, join_class: "header-body")
      }
    end
    concat (:div, main, join_class: "main-wrapper")
    concat (:div, body, join_class: "body")
    concat (:div, footer, join_class: "footer")
    concat content_for(:modal)
  end
end