class ActionText::TrixAttachment
def from_attributes(attributes)
def from_attributes(attributes) attributes = process_attributes(attributes) trix_attachment_attributes = attributes.except(*COMPOSED_ATTRIBUTES) trix_attributes = attributes.slice(*COMPOSED_ATTRIBUTES) node = ActionText::HtmlConversion.create_element(TAG_NAME) node["data-trix-attachment"] = JSON.generate(trix_attachment_attributes) node["data-trix-attributes"] = JSON.generate(trix_attributes) if trix_attributes.any? new(node) end