class
Importance_2
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Superclass: ActiveRecord::Base

Action Text RichText

The RichText record holds the content produced by the Trix editor in a serialized body attribute. It also holds all the references to the embedded files, which are stored using Active Storage. This record is then associated with the Active Record model the application desires to have rich text content using the has_rich_text class method.

class Message < ActiveRecord::Base
  has_rich_text :content
end

message = Message.create!(content: "<h1>Funny times!</h1>")
message.content #=> #<ActionText::RichText....
message.content.to_s # => "<h1>Funny times!</h1>"
message.content.to_plain_text # => "Funny times!"
Show files where this class is defined (1 file)
Register or log in to add new notes.