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

Version Path
renalware-core-2.0.37 app/helpers/renalware/article_helper.rb
renalware-core-2.0.36 app/helpers/renalware/article_helper.rb
renalware-core-2.0.35 app/helpers/renalware/article_helper.rb
renalware-core-2.0.34 app/helpers/renalware/article_helper.rb
renalware-core-2.0.33 app/helpers/renalware/article_helper.rb
renalware-core-2.0.32 app/helpers/renalware/article_helper.rb
renalware-core-2.0.31 app/helpers/renalware/article_helper.rb
renalware-core-2.0.30 app/helpers/renalware/article_helper.rb
renalware-core-2.0.28 app/helpers/renalware/article_helper.rb
renalware-core-2.0.27 app/helpers/renalware/article_helper.rb
renalware-core-2.0.26 app/helpers/renalware/article_helper.rb
renalware-core-2.0.25 app/helpers/renalware/article_helper.rb
renalware-core-2.0.24 app/helpers/renalware/article_helper.rb
renalware-core-2.0.23 app/helpers/renalware/article_helper.rb
renalware-core-2.0.22 app/helpers/renalware/article_helper.rb
renalware-core-2.0.21 app/helpers/renalware/article_helper.rb
renalware-core-2.0.20 app/helpers/renalware/article_helper.rb
renalware-core-2.0.18 app/helpers/renalware/article_helper.rb
renalware-core-2.0.17 app/helpers/renalware/article_helper.rb