Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Configure the options of the editor #6

Open
stanlocht opened this issue Apr 25, 2022 · 2 comments
Open

Configure the options of the editor #6

stanlocht opened this issue Apr 25, 2022 · 2 comments

Comments

@stanlocht
Copy link

Hi!
Simple and quick question: How do I configure the options of the editor to (for example) disable the spell checker?

I tried this but it did not work:
f.input :text, as: :simplemde_editor, input_html: { data: { options: { spellChecker: false } } }

Tips would be greatly appreciated!

@trahfo
Copy link

trahfo commented May 18, 2022

plus 1

@timwaters
Copy link

Turns out the code doesn't pass in options correctly.
simplemde_editor_input.js needs to be edited:

$(document).ready(function () {
  $('.simplemde-editor').each(function () {
      var options = { element: $(this).get(0) };
      options = $.extend({}, options, $(this).data('options'));
      new SimpleMDE(  options );
  });
});

and usage in the activeadmin model

 f.input :text, as: :simplemde_editor, input_html:=> { "data-options" => '{"status": false, "spellChecker": false}'}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants