Module: Renalware::ArticleHelper

Defined in:
app/helpers/renalware/article_helper.rb

Instance Method Summary collapse

Instance Method Details

#article_tag(title = nil, options = nil, &block) ⇒ Object

Renders: <article>

<header>
  <h1>[title]</h1>
</header>
[yielded content]

</article>



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/renalware/article_helper.rb', line 12

def (title = nil, options = nil, &block)
  output = tag(:article, options, true)
  if title.present?
    output.safe_concat(
      ("header") do
        ("h1", title)
      end
    )
  end
  output.concat(capture(&block)) if block_given?
  output.safe_concat("</article>")
end