Methods
- attachable_plain_text_representation
- from_node
- to_partial_path
- to_trix_content_attachment_partial_path
Included Modules
Attributes
[RW] | name |
Class Public methods
from_node(node)
📝 Source code
# 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
🔎 See on GitHub
Instance Public methods
attachable_plain_text_representation(caption)
📝 Source code
# File actiontext/lib/action_text/attachables/content_attachment.rb, line 20
def attachable_plain_text_representation(caption)
case name
when "horizontal-rule"
" ┄ "
else
" "
end
end
🔎 See on GitHub
to_partial_path()
📝 Source code
# File actiontext/lib/action_text/attachables/content_attachment.rb, line 29
def to_partial_path
"action_text/attachables/content_attachment"
end
🔎 See on GitHub
to_trix_content_attachment_partial_path()
📝 Source code
# File actiontext/lib/action_text/attachables/content_attachment.rb, line 33
def to_trix_content_attachment_partial_path
"action_text/attachables/content_attachments/#{name.underscore}"
end
🔎 See on GitHub