instance method attachable_markdown_representation

Ruby on Rails edge

Since edge

Signature

attachable_markdown_representation(caption = nil, attachment_links: false)

No documentation comment.

Parameters

caption opt = nil
attachment_links key = false
Source
# 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)
            MarkdownConversion.markdown_link(title, url, image: image?)
          else
            "\\[#{MarkdownConversion.escape_markdown_text(title)}\\]"
          end
        end

Defined in actiontext/lib/action_text/engine.rb line 63 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionText::Engine

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close