123456789_123456789_123456789_123456789_123456789_

Module: ActionText::Attachments::Conversion

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: actiontext/lib/action_text/attachments/conversion.rb

Class Method Summary

::ActiveSupport::Concern - Extended

class_methods

Define class methods from given block.

included

Evaluate given block in context of base class, so that you can write class macros here.

prepended

Evaluate given block in context of base class, so that you can write class macros here.

append_features, prepend_features

Instance Method Summary

Instance Method Details

#editor_attachment_content (private)

[ GitHub ]

  
# File 'actiontext/lib/action_text/attachments/conversion.rb', line 32

def editor_attachment_content
  if partial_path = (
      attachable.try(:to_editor_content_attachment_partial_path) ||
      ActionText.deprecator.silence { attachable.try(:to_trix_content_attachment_partial_path) }
    )
    ActionText::Content.render(partial: partial_path, formats: :html, object: self, as: model_name.element)
  end
end

#to_editor_attachment

[ GitHub ]

  
# File 'actiontext/lib/action_text/attachments/conversion.rb', line 20

def to_editor_attachment
  dup.to_editor_attachment!
end

#to_editor_attachment!

[ GitHub ]

  
# File 'actiontext/lib/action_text/attachments/conversion.rb', line 24

def to_editor_attachment! # :nodoc:
  if (content = editor_attachment_content)
    node["content"] = content
  end
  self
end