Module ActionView::Helpers::TagHelper
In: lib/action_view/helpers/tag_helper.rb

This is poor man’s Builder for the rare cases where you need to programmatically make tags but can’t use Builder.

Methods

content_tag   tag  

Included Modules

ERB::Util

Public Instance methods

Examples:

  • content_tag("p", "Hello world!") => <p>Hello world!</p>
  • content_tag("div", content_tag("p", "Hello world!"), "class" => "strong") => <div class="strong"><p>Hello world!</p></div>

Examples:

  • tag("br") => <br />
  • tag("input", { "type" => "text"}) => <input type="text" />

[Validate]