Var

The HTML <var> tag, implemented in Ruby.

Parameters

This component accepts all the canonical HTML global attributes like id or class.

text - optional

If given will render the text within the var tags

Examples

Example 1: Yield a given block

var id: "foo", class: "bar" do
  plain 'Simple text'
end

returns

<var id="foo" class="bar">
  Simple text
</var>

Example 2: Render options[:text] param

var id: "foo", class: "bar", text: 'Simple text'

returns

<var id="foo" class="bar">
  Simple text
</var>

Last updated