instance method render_attachment

Ruby on Rails edge

Since edge

Signature

render_attachment(attachment, attachment_links: false)

Returns an element holding attachment‘s Markdown, for `ActionText::Content#to_markdown` to substitute in place of the attachment. #node_to_markdown emits the element’s text verbatim rather than escaping it as ordinary Markdown source.

Parameters

attachment req
attachment_links key = false
Source
# File actiontext/lib/action_text/markdown_conversion.rb, line 55
    def render_attachment(attachment, attachment_links: false)
      ActionText::HtmlConversion.create_element(RAW_MARKDOWN_TAG_NAME).tap do |node|
        node.content = attachment.to_markdown(attachment_links: attachment_links)
      end
    end

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

Defined in ActionText::MarkdownConversion

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