instance method
strip_links
Ruby on Rails 3.1.12
Since v2.2.3Signature
strip_links(html)
Strips all link tags from text leaving just the link text.
Examples
strip_links('<a href="http://www.rubyonrails.org">Ruby on Rails</a>') # => Ruby on Rails strip_links('Please e-mail me at <a href="mailto:me@email.com">me@email.com</a>.') # => Please e-mail me at me@email.com. strip_links('Blog: <a href="http://www.myblog.com/" class="nav" target=\"_blank\">Visit</a>.') # => Blog: Visit.
Parameters
-
htmlreq
Source
# File actionpack/lib/action_view/helpers/sanitize_helper.rb, line 98
def strip_links(html)
self.class.link_sanitizer.sanitize(html)
end
Defined in actionpack/lib/action_view/helpers/sanitize_helper.rb line 98
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::SanitizeHelper