Module: TrixEmbed::ApplicationHelper

Defined in:
app/helpers/trix_embed/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#trix_embed_attachment(local_assigns = {}) ⇒ Object



5
6
7
8
9
# File 'app/helpers/trix_embed/application_helper.rb', line 5

def trix_embed_attachment(local_assigns = {})
  return local_assigns[:attachable] if local_assigns[:attachable].is_a?(TrixEmbed::Attachment)
  return local_assigns[:attachment].attachable if local_assigns[:attachment]&.attachable.is_a?(TrixEmbed::Attachment)
  nil
end