Module: ActiveSupport::CoreExt::ERBUtil
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | activesupport/lib/active_support/core_ext/erb/util.rb |
Instance Method Summary
-
#h(s)
Alias for #html_escape.
-
#html_escape(s)
(also: #unwrapped_html_escape, #h)
Internal use only
A utility method for escaping HTML tag characters.
-
#unwrapped_html_escape(s)
Internal use only
Alias for #html_escape.
Instance Method Details
#h(s)
Alias for #html_escape.
# File 'activesupport/lib/active_support/core_ext/erb/util.rb', line 28
alias h html_escape
#html_escape(s) Also known as: #unwrapped_html_escape, #h
This method is for internal use only.
A utility method for escaping HTML tag characters. This method is also aliased as h
.
puts html_escape('is a > 0 & a < 10?')
# => is a > 0 & a < 10?
See additional method definition at line 10.
# File 'activesupport/lib/active_support/core_ext/erb/util.rb', line 25
def html_escape(s) # :nodoc: s = s.to_s if s.html_safe? s else super(ActiveSupport::Multibyte::Unicode.tidy_bytes(s)) end end
#unwrapped_html_escape(s)
This method is for internal use only.
Alias for #html_escape.
# File 'activesupport/lib/active_support/core_ext/erb/util.rb', line 18
alias :unwrapped_html_escape :html_escape # :nodoc: