方法
实例公共方法
fragment_by_converting_trix_attachments(content) 链接
源代码: 显示 | 在 GitHub 上
# File actiontext/lib/action_text/attachments/trix_conversion.rb, line 13 def fragment_by_converting_trix_attachments(content) Fragment.wrap(content).replace(TrixAttachment::SELECTOR) do |node| from_trix_attachment(TrixAttachment.new(node)) end end
from_trix_attachment(trix_attachment) 链接
源代码: 显示 | 在 GitHub 上
# File actiontext/lib/action_text/attachments/trix_conversion.rb, line 19 def from_trix_attachment(trix_attachment) from_attributes(trix_attachment.attributes) end
to_trix_attachment(content = trix_attachment_content) 链接
源代码: 显示 | 在 GitHub 上
# File actiontext/lib/action_text/attachments/trix_conversion.rb, line 24 def to_trix_attachment(content = trix_attachment_content) attributes = full_attributes.dup attributes["content"] = content if content TrixAttachment.from_attributes(attributes) end