我目前正在使用https://github.com/spohlenz/tinymce-rails找到的 tinymce-rails gem ,我无法让拼写检查器初始化。TinyMCE 编辑器可以正常工作。
Javascript:
tinyMCE.init({
mode: "specific_textareas",
editor_selector: "tinymce",
theme: "advanced",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_buttons1: "bold,italic,underline,bullist,numlist",
theme_advanced_buttons3: "tablecontrols,fullscreen,spellchecker",
plugins: "table,autoresize,fullscreen,spellchecker",
width: "100%",
height: 400,
autoresize_min_height: 400,
autoresize_max_height: 800,
language:"en",
spellchecker_languages: "+English=en"
});
erb<%= f.text_area :completed, :class => "tinymce", :size => 500 %>
生成以下内容:
<body id="tinymce" class="mceContentBody " contenteditable="true" onload="window.parent.tinyMCE.get('report_completed').onLoad.dispatch();" spellcheck="false" style="overflow-y: hidden; padding-bottom: 50px;" dir="ltr">
我注意到拼写检查字段是错误的,但我不确定为什么,或者这实际上与问题有关。