Module | ActionView::Helpers::TagHelper |
In: |
vendor/rails/actionpack/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.
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 <![CDATA[ and end with (and may not contain) the string ]]>.
# File vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb, line 30 30: def cdata_section(content) 31: "<![CDATA[#{content}]]>" 32: end
Examples:
# File vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb, line 21 21: def content_tag(name, content, options = nil) 22: "<#{name}#{tag_options(options.stringify_keys) if options}>#{content}</#{name}>" 23: end