instance method
html_escape
Ruby on Rails 8.0.4
Since v7.1.6 PrivateSignature
html_escape(s)
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?
Parameters
-
sreq
Source
# File activesupport/lib/active_support/core_ext/erb/util.rb, line 25
def html_escape(s) # rubocop:disable Lint/DuplicateMethods
unwrapped_html_escape(s).html_safe
end
Defined in activesupport/lib/active_support/core_ext/erb/util.rb line 25
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::CoreExt::ERBUtil