instance method to_s

Ruby on Rails 7.2.3

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

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 157
    def to_s
      to_rendered_html_with_layout
    end

Defined in actiontext/lib/action_text/content.rb line 157 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionText::Content

Type at least 2 characters to search.

↑↓ navigate · open · esc close