method

to_plain_text

rails latest stable - Class: ActionText::RichText
to_plain_text()
public

Returns the body attribute as plain text with all HTML tags removed.

message = Message.create!(content: "<h1>Funny times!</h1>")
message.content.to_plain_text # => "Funny times!"