Method: ActionText::Content#attachables
- Defined in:
- actiontext/lib/action_text/content.rb
#attachables ⇒ Object
Extracts ActionText::Attachable objects from the HTML fragment:
attachable = ActiveStorage::Blob.first
html = %Q(<action-text-attachment sgid="#{attachable.attachable_sgid}" caption="Captioned"></action-text-attachment>)
content = ActionText::Content.new(html)
content.attachables # => [attachable]
87 88 89 90 91 |
# File 'actiontext/lib/action_text/content.rb', line 87 def attachables @attachables ||= .map do |node| ActionText::Attachable.from_node(node) end end |