instance method
to_s
Ruby on Rails 8.1.2
Since v6.0.6Signature
to_s()
Safely transforms Content into an HTML String.
content = ActionText::Content.new(content: "<h1>Funny times!</h1>") content.to_s # => "<h1>Funny times!</h1>" content = ActionText::Content.new("<div onclick='action()'>safe<script>unsafe</script></div>") content.to_s # => "<div>safeunsafe</div>"
Source
# File actiontext/lib/action_text/content.rb, line 158
def to_s
to_rendered_html_with_layout
end
Defined in actiontext/lib/action_text/content.rb line 158
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionText::Content