Sha256: 0c5507b765bfd4036b92d56f20c98332acb9f99383423c772fa8e5cb866231c9
Contents?: true
Size: 589 Bytes
Versions: 19
Compression:
Stored size: 589 Bytes
Contents
# frozen_string_literal: true module Renalware module ArticleHelper # Renders: # <article> # <header> # <h1>[title]</h1> # </header> # [yielded content] # </article> def article_tag(title = nil, options = nil, &block) output = tag(:article, options, true) if title.present? output.safe_concat( content_tag("header".freeze) do content_tag("h1".freeze, title) end ) end output.concat(capture(&block)) if block_given? output.safe_concat("</article>") end end end
Version data entries
19 entries across 19 versions & 1 rubygems