Module: Pagescript::TagsHelper
- Defined in:
- lib/pagescript/helpers/tags_helper.rb
Overview
A helper that creates elements with metadata attached as data attributes.
Instance Method Summary collapse
-
#body_tag(params_as_metadata: false, **kwargs) { ... } ⇒ String
Generates a ‘<body>` tag with HTML5 data attributes for the controller & action name.
Instance Method Details
#body_tag(params_as_metadata: false, **kwargs) { ... } ⇒ String
Generates a ‘<body>` tag with HTML5 data attributes for the controller & action name. The keyword arguments are forwarded to tag and content_tag.
29 30 31 32 33 34 35 36 |
# File 'lib/pagescript/helpers/tags_helper.rb', line 29 def body_tag(params_as_metadata: false, **kwargs) = kwargs.deep_merge( data: data_attrs() ) if block_given? content_tag(:body, ) { yield } else tag(:body, , true) end end |