module
Importance_1
v7.1.3.2 - Show latest stable - 0 notes

Action 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]

Constants

LOCATOR_NAME = "attachable"

Attributes

Show files where this module is defined (1 file)
Register or log in to add new notes.