instance method
html_safe
Ruby on Rails edge
Since v2.3.18Signature
html_safe()
Marks a string as trusted safe. It will be inserted into HTML with no
additional escaping performed. It is your responsibility to ensure that the
string contains no malicious content. This method is equivalent to the
`raw` helper in views. It is recommended that you use `sanitize` instead of
this method. It should never be called on user input.
: () -> ActiveSupport::SafeBuffer
Source
# File activesupport/lib/active_support/core_ext/string/output_safety.rb, line 244
def html_safe
ActiveSupport::SafeBuffer.new(self)
end
Defined in activesupport/lib/active_support/core_ext/string/output_safety.rb line 244
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String