Class: ActionText::Editor::TrixEditor

Inherits:
ActionText::Editor show all
Defined in:
actiontext/lib/action_text/editor/trix_editor.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Tag

Instance Attribute Summary

Attributes inherited from ActionText::Editor

#options

Instance Method Summary collapse

Methods inherited from ActionText::Editor

#editor_name, #initialize

Methods included from ActiveSupport::Autoload

#autoload, #autoload_at, #autoload_under, #eager_autoload, #eager_load!

Constructor Details

This class inherits a constructor from ActionText::Editor

Instance Method Details

#as_canonical(editable_fragment) ⇒ Object



5
6
7
# File 'actiontext/lib/action_text/editor/trix_editor.rb', line 5

def as_canonical(editable_fragment)
  editable_fragment.replace(TrixAttachment::SELECTOR, &method(:from_trix_attachment))
end

#as_editable(canonical_fragment) ⇒ Object



9
10
11
# File 'actiontext/lib/action_text/editor/trix_editor.rb', line 9

def as_editable(canonical_fragment)
  canonical_fragment.replace(Attachment.tag_name, &method(:to_trix_attachment))
end

#editor_tagObject



13
14
15
# File 'actiontext/lib/action_text/editor/trix_editor.rb', line 13

def editor_tag(...)
  Tag.new(editor_name, ...)
end