class ActionText::RichText

Overview

https://martenframework.com/docs/models-and-databases/introduction#timestamps

Defined in:

action_text/rich_text.cr

Constant Summary

ATTACHMENT_ATTRIBUTES = ["content-type", "href", "filename", "filesize", "width", "height", "previewable", "presentation", "caption", "content"] of ::String
FIELDS_ = {"created_at" => {type: "date_time", kwargs: {auto_now_add: true}}, "updated_at" => {type: "date_time", kwargs: {auto_now: true}}, "id" => {type: "big_int", kwargs: {primary_key: true, auto: true}}, "name" => {type: "string", kwargs: {max_size: 255}}, "body" => {type: "text", kwargs: ::NamedTuple.new}, "record_type" => {type: "string", kwargs: {max_size: 255}}, "record_id" => {type: "big_int", kwargs: ::NamedTuple.new}} of Nil => Nil

Ported from Rails ActionText::RichText: https://github.com/rails/rails/blob/main/actiontext/app/models/action_text/rich_text.rb

In Rails + Trix, the attachment SGID is generated server-side after upload (when Rails has an attachable record, usually ActiveStorage::Blob) and then injected into the action-text-attachment payload saved in RichText body.

Example Rails metadata payload observed for uploaded rich text attachments: {"_rails":{"data":"gid://drar/ActiveStorage::Blob/13?expires_in","pur":"attachable"}}

https://www.rubydoc.info/docs/rails/ActionText/Attachable https://guides.rubyonrails.org/action_text_overview.html

Class Method Summary

Instance Method Summary

Class Method Detail

def self.get_or_initialize_by(**kwargs) #

Instance Method Detail

def attachments #

def blobs #

def body : String | Nil | Nil #

def body! #

def body=(body : String | Nil | Nil) #

def body? #

def build_xml_image(parent, url : String) #

def created_at : Time | Nil | Nil #

def created_at! #

def created_at=(created_at : Time | Nil | Nil) #

def created_at? #

def id : Int32 | Int64 | Nil | Nil #

def id! #

def id=(id : Int32 | Int64 | Nil | Nil) #

def id? #

def name : String | Nil | Nil #

def name! #

def name=(name : String | Nil | Nil) #

def name? #

def record_id : Int32 | Int64 | Nil | Nil #

def record_id! #

def record_id=(record_id : Int32 | Int64 | Nil | Nil) #

def record_id? #

def record_type : String | Nil | Nil #

def record_type! #

def record_type=(record_type : String | Nil | Nil) #

def record_type? #

def to_html #

def to_plain_text #

def updated_at : Time | Nil | Nil #

def updated_at! #

def updated_at=(updated_at : Time | Nil | Nil) #

def updated_at? #