module Attachable
Ruby on Rails 7.2.3
Since v6.0.6Action Text Attachable
Include this module to make a record attachable to an ActionText::Content.
class Person < ApplicationRecord include ActionText::Attachable end person = Person.create! name: "Javan" html = %Q(<action-text-attachment sgid="#{person.attachable_sgid}"></action-text-attachment>) content = ActionText::Content.new(html) content.attachables # => [person]
Extends
Constants
Methods (defined here)
- # attachable_content_type
- # attachable_filename
- # attachable_filesize
- # attachable_metadata
- # attachable_sgid
- # from_attachable_sgid
- # previewable_attachable?
- # to_attachable_partial_path
- # to_missing_attachable_partial_path
- # to_rich_text_attributes
- # to_trix_content_attachment_partial_path
- self. from_attachable_sgid
- self. from_node
Private methods
(3)
Implementation detail — not part of the public API.
Used by
Included by (1)
Methods (inherited)
From ActiveSupport::Concern (3)
- # class_methods
- # included
- # prepended