Sha256: bf4c56e43538d50de737607c73c88c9e56756925754ff9ba48e2e19a061e3bf7

Contents?: true

Size: 661 Bytes

Versions: 10

Compression:

Stored size: 661 Bytes

Contents

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

  def read_only_editor(content, language, options = {})
    editor_options = editor_defaults(language, options.deep_merge(data: { readonly: true }), 'editor')
    text_area_tag 'solution[content]', content, editor_options
  end

  def spell_checked_editor(name, options = {})
    editor_options = editor_defaults('markdown', options, 'form-control mu-spell-checked-editor')
    text_area_tag name, '', editor_options
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mumuki-laboratory-9.23.0 app/helpers/editor_helper.rb
mumuki-laboratory-9.22.0 app/helpers/editor_helper.rb
mumuki-laboratory-9.21.0 app/helpers/editor_helper.rb
mumuki-laboratory-9.20.1 app/helpers/editor_helper.rb
mumuki-laboratory-9.20.0 app/helpers/editor_helper.rb
mumuki-laboratory-9.19.0 app/helpers/editor_helper.rb
mumuki-laboratory-9.18.1 app/helpers/editor_helper.rb
mumuki-laboratory-9.18.0 app/helpers/editor_helper.rb
mumuki-laboratory-9.17.0 app/helpers/editor_helper.rb
mumuki-laboratory-9.16.0 app/helpers/editor_helper.rb