Pre

Component Documentation

matestack core component: Pre

Show specs

The HTML pre tag implemented in ruby.

Parameters

This component can take 3 optional configuration params and either yield content or display what gets passed to the text configuration param.

# id (optional)

Expects a string with all ids the pre should have.

# class (optional)

Expects a string with all classes the pre should have.

# text (optional)

Expects a ruby string with the text the address tag should show.

Example 1: Yield a given block

pre id: "foo", class: "bar" do
  plain 'Hello World' # optional content
end

returns

<pre id="foo" class="bar">
  Hello World
</pre>

Example 2: Render options[:text] param

pre id: "foo", class: "bar", text: 'Hello World'

returns

<pre id="foo" class="bar">
  Hello World
</pre>