class method
self.html_escape_once
Ruby on Rails 8.1.2
Since v4.0.13Signature
self.html_escape_once(s)
A utility method for escaping HTML without affecting existing escaped entities.
html_escape_once('1 < 2 & 3') # => "1 < 2 & 3" html_escape_once('<< Accept & Checkout') # => "<< Accept & Checkout"
Parameters
-
sreq
Source
# File activesupport/lib/active_support/core_ext/erb/util.rb, line 63
def html_escape_once(s)
s.to_s.gsub(HTML_ESCAPE_ONCE_REGEXP, HTML_ESCAPE).html_safe
end
Defined in activesupport/lib/active_support/core_ext/erb/util.rb line 63
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ERB::Util