Module: EditorHelper

Defined in:
app/helpers/editor_helper.rb

Instance Method Summary collapse

Instance Method Details

#editor_defaults(language, options, styles = '') ⇒ Object



2
3
4
5
6
7
# File 'app/helpers/editor_helper.rb', line 2

def editor_defaults(language, options, styles = '')
  {class: styles,
   data: {placeholder: I18n.t(:editor_placeholder),
          'editor-language' => language},
   rows: 15}.deep_merge(options)
end

#read_only_editor(content, language, options = {}) ⇒ Object



9
10
11
12
# File 'app/helpers/editor_helper.rb', line 9

def read_only_editor(content, language, options = {})
  editor_options = editor_defaults(language, options, 'read-only-editor')
  text_area_tag :solution_content, content, editor_options
end