Module: Renalware::ArticleHelper
- Defined in:
- app/helpers/renalware/article_helper.rb
Instance Method Summary collapse
-
#article_tag(title = nil, options = nil, &block) ⇒ Object
Renders: <article> <header> <h1></h1> </header> [yielded content] </article>.
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 article_tag(title = nil, = nil, &block) output = tag(:article, , true) if title.present? output.safe_concat( content_tag("header") do content_tag("h1", title) end ) end output.concat(capture(&block)) if block_given? output.safe_concat("</article>") end |