class method
self.from_node
Ruby on Rails 6.1.7.10
Since v6.0.6 Last seen in v7.0.10Signature
self.from_node(node)
No documentation comment.
Parameters
-
nodereq
Source
# File actiontext/lib/action_text/attachables/content_attachment.rb, line 8
def self.from_node(node)
if node["content-type"]
if matches = node["content-type"].match(/vnd\.rubyonrails\.(.+)\.html/)
attachment = new(name: matches[1])
attachment if attachment.valid?
end
end
end
Defined in actiontext/lib/action_text/attachables/content_attachment.rb line 8
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionText::Attachables::ContentAttachment