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

cdata_section content_tag tag

### Included Modules

ERB::Util

### Public Instance methods

cdata_section(content)

Returns a CDATA section for the given `content`. CDATA sections are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string `&lt;![CDATA[` and end with (and may not contain) the string `]]>`.

content_tag(name, content, options = nil)

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>`

tag(name, options = nil, open = false)

Examples:

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

[Validate]