Class: ActionText::Editor::Tag

Inherits:
Object
  • Object
show all
Defined in:
actiontext/lib/action_text/editor.rb

Overview

:nodoc:

Direct Known Subclasses

ActionText::Editor::TrixEditor::Tag

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(editor_name, options = {}) ⇒ Tag

Returns a new instance of Tag.



61
62
63
64
# File 'actiontext/lib/action_text/editor.rb', line 61

def initialize(editor_name, options = {})
  @editor_name = editor_name
  @options = options
end

Instance Attribute Details

#editor_nameObject (readonly)

Returns the value of attribute editor_name.



58
59
60
# File 'actiontext/lib/action_text/editor.rb', line 58

def editor_name
  @editor_name
end

#optionsObject (readonly)

Returns the value of attribute options.



59
60
61
# File 'actiontext/lib/action_text/editor.rb', line 59

def options
  @options
end

Instance Method Details

#element_nameObject



66
67
68
# File 'actiontext/lib/action_text/editor.rb', line 66

def element_name
  "#{editor_name}-editor"
end

#render_in(view_context) ⇒ Object



70
71
72
73
74
# File 'actiontext/lib/action_text/editor.rb', line 70

def render_in(view_context)
  options[:class] ||= "#{editor_name}-content"

  view_context.(element_name, nil, options)
end