我在我的 rails 应用程序中使用了 Tinymce 编辑器。当我尝试将文本设置为粗体并保存时,不会反映文本更改。
宝石文件
gem 'tinymce-rails'
conig/tinymce.yml
selector: textarea.table-editor
theme: modern
selector: textarea
toolbar: styleselect | bold italic | undo redo | table | alignleft
aligncenter alignright alignjustify | bullist numlist outdent indent | ink image | print preview media fullpage | forecolor backcolor | emoticons
plugins:
- table
- advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker
- searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking
- save table contextmenu directionality emoticons template paste textcolor
应用程序.js
//= require tinymce
东西.html.erb
<%= tinymce_assets %>
<%= tinymce %>
<%= form.text_area :description, :class => "tinymce", id: :course_description %>
显示.html.erb
<%= @course.description.html_safe %>