Skip to Content Skip to Search
Methods
A
P
T
Included Modules

Instance Public methods

attachable_markdown_representation(caption = nil, attachment_links: false)

# File actiontext/lib/action_text/engine.rb, line 63
def attachable_markdown_representation(caption = nil, attachment_links: false)
  title = (caption || filename).to_s

  if attachment_links
    renderer = ActionText::Content.renderer
    raise ArgumentError, "attachment_links requires a rendering context" unless renderer

    url = renderer.url_for(self)
    if image?
      "!#{MarkdownConversion.markdown_link(title, url)}"
    else
      MarkdownConversion.markdown_link(title, url)
    end
  else
    "[#{MarkdownConversion.escape_markdown_text(title)}]"
  end
end

attachable_plain_text_representation(caption = nil)

# File actiontext/lib/action_text/engine.rb, line 59
def attachable_plain_text_representation(caption = nil)
  "[#{caption || filename}]"
end

previewable_attachable?()

# File actiontext/lib/action_text/engine.rb, line 55
def previewable_attachable?
  representable?
end

to_editor_content_attachment_partial_path()

# File actiontext/lib/action_text/engine.rb, line 86
def to_editor_content_attachment_partial_path
  nil
end

to_trix_content_attachment_partial_path()

# File actiontext/lib/action_text/engine.rb, line 81
def to_trix_content_attachment_partial_path
  to_editor_content_attachment_partial_path
end