Class: BlockEditor::Instance

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::FormTagHelper, ActionView::Helpers::TagHelper
Defined in:
lib/block_editor/instance.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#output_bufferObject

Returns the value of attribute output_buffer.



6
7
8
# File 'lib/block_editor/instance.rb', line 6

def output_buffer
  @output_buffer
end

Class Method Details

.render(form_builder) ⇒ Object



8
9
10
# File 'lib/block_editor/instance.rb', line 8

def self.render(form_builder)
  self.new.render(form_builder)
end

Instance Method Details

#render(form_builder) ⇒ Object



12
13
14
15
16
17
# File 'lib/block_editor/instance.rb', line 12

def render(form_builder)
  (:div, data: { controller: 'block-editor' }) do
    form_builder.hidden_field(:content, data: { 'block-editor-target' => 'input' }) +
      ('div', nil, { class: 'block-editor', data: { 'block-editor-target' => 'output' } })
  end
end