ruby-on-rails - Tinymce-rails 为第二个工具栏正确配置 tinymce.yml?

标签 ruby-on-rails ruby tinymce-4

仅与一个工具栏完美配合,但当我尝试使用 Rails 4.2 中 yaml 文件中文档中的工具栏配置模式时,编辑器完全消失了。这是我的 yaml 文件,我做错了什么?

menubar: false
paste_merge_formats: true
paste_retain_style_properties: all
toolbar:
  - formatselect | fontselect | fontsizeselect | bold | italic | underline | strikethrough | alignleft | aligncenter | alignjustify | alignright
toolbar2:
  - bullist | numlist | outdent | indent | blockquote | forecolor | backcolor | undo | redo | link | unlink | preview | hr | searchreplace
plugins:
  - link
  - paste
  - importcss
  - autolink
  - lists
  - wordcount
  - colorpicker
  - hr
  - preview
  - searchreplace
  - textcolor

最佳答案

如果我对您的理解正确并且您希望 toolbar2 中的项目显示为格式选项,那么您只需删除 toolbar2 声明,您将在菜单中获得 toolbar2 格式选项。 像这样:

toolbar:
  - formatselect | fontselect | fontsizeselect | bold | italic | underline | strikethrough | alignleft | aligncenter | alignjustify | alignright
  - bullist | numlist | outdent | indent | blockquote | forecolor | backcolor | undo | redo | link | unlink | preview | hr | searchreplace
plugins:
        ...

关于ruby-on-rails - Tinymce-rails 为第二个工具栏正确配置 tinymce.yml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32955386/

相关文章:

ruby-on-rails - Ruby 变量仅分配给关键字 "new"

javascript - TinyMCE 4 : Apply one block format to new blocks automatically

javascript - Rails 4 Cocoon Gem + bootstrap 日期选择器

ruby-on-rails - Postgres排序问题

ruby - Rspec `eq` 与 `eql` 测试中的 `expect`

ruby-on-rails - 在 Rails 中自定义 "Password confirmation doesn' t 匹配密码

tinymce - 使用 TinyMCE 4 Hook onExecCommand 事件

javascript - Wordpress/TinyMCE - Hook /过滤器在 url 中添加目标 ="_blank"

ruby-on-rails - 如何从 Rails 发送纯文本而不是 HTML 电子邮件?

ruby-on-rails - 如何在文本字段rails postgresql中查询json数据