Class: SimpleFormMarkdownEditor::MarkdownEditorInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
lib/simple_form_markdown_editor/markdown_editor_input.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration



7
8
9
# File 'lib/simple_form_markdown_editor/markdown_editor_input.rb', line 7

def configuration
  @configuration
end

Class Method Details

.configure {|@configuration| ... } ⇒ Object

Yields:



9
10
11
12
# File 'lib/simple_form_markdown_editor/markdown_editor_input.rb', line 9

def configure
  @configuration ||= Configuration.new
  yield @configuration
end

Instance Method Details

#input(wrapper_options) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/simple_form_markdown_editor/markdown_editor_input.rb', line 21

def input(wrapper_options)
  attrs = merge_wrapper_options(input_html_options, wrapper_options)
  attrs[:class] = [SimpleFormMarkdownEditor.dom_class, SimpleFormMarkdownEditor.dom_class(:is_editor)]
  attrs[:class] << SimpleFormMarkdownEditor.dom_class(:is_help) if help_visible?
  attrs[:data] ||= {}
  attrs[:data][:preview_path] = preview_path
  attrs[:data][:options] = { render_class: render_class, render_options: render_options, extensions: extensions }

  template. :div, attrs do
    template.concat header
    template.concat help
    template.concat editor
    template.concat preview
  end
end