class Attachment
Ruby on Rails 7.2.3
Since v6.0.6Action Text Attachment
Attachments serialize attachables to HTML or plain text.
class Person < ApplicationRecord include ActionText::Attachable end attachable = Person.create! name: "Javan" attachment = ActionText::Attachment.from_attachable(attachable) attachment.to_html # => "<action-text-attachment sgid=\"BAh7CEk..."
Inherits from
Constants
Attributes
Methods (defined here)
- # caption
- # full_attributes
- # inspect
- # to_html
- # to_plain_text
- # to_s
- # with_full_attributes
- self. fragment_by_canonicalizing_attachments
- self. from_attachable
- self. from_attachables
- self. from_attributes
- self. from_node
- self. new
Private methods
(5)
Implementation detail — not part of the public API.
Methods (inherited)
From Object (17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # with
- # with_options
From ActiveSupport::NumericWithFormat (2)
- # to_formatted_s
- # to_fs