class method self.from_node

Ruby on Rails 6.1.7.10

Since v6.0.6 Last seen in v7.0.10

Available in: v6.0.6 v6.1.7.10 v7.0.10

Signature

self.from_node(node)

No documentation comment.

Parameters

node req
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close