javascript - Ruby on Rails - 如何将 ckeditor 插件与 rails 6 集成
问题描述
所以,我正在使用带有 rails 6 的 ckeditor gem;
javascript/packs/application.js:
require("packs/ckeditor/config")
javascript/packs/ckeditor/config.js:
CKEDITOR.editorConfig = function( config )
{
config.extraPlugins = 'eqneditor,imageresizerowandcolumn,balloontoolbar,balloonpanel';
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.resize_enabled = true;
/* Filebrowser routes */
// The location of an external file browser, that should be launched when "Browse Server" button is pressed.
config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog.
config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
// The location of a script that handles file uploads in the Flash dialog.
config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog.
config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog.
config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
// The location of a script that handles file uploads in the Image dialog.
config.filebrowserImageUploadUrl = "/ckeditor/pictures?";
// The location of a script that handles file uploads.
config.filebrowserUploadUrl = "/ckeditor/attachment_files";
config.allowedContent = true;
config.filebrowserUploadMethod = 'form';
};
意见:
<%= javascript_include_tag Ckeditor.cdn_url%>
<%= cktext_area :notes, ckeditor: {toolbar: 'Full'}%>
编辑器正确加载,但我没有看到我在 ckeditor 的 config.js 中配置的任何插件
解决方案
推荐阅读
- php - 数组中的正确图像路径
- salesforce - SingleEmailMessage 和 cc 的问题
- css - 如何并排放置 2 个图像而它们之间没有空格?
- reactjs - 如何使用 .NET Core 与 redux 项目反应基于反应组件修改页面标题?
- javascript - IE 11 上的 MutationObserver 语法错误
- c# - 同一实体类型的一对一和一对多
- r - 更改分组条形图中的条形颜色
- c++ - 选择派生实例基类专用的类模板
- c# - 用于计算着色器步幅的自定义结构的 sizeof
- css - 将 Css 表单与页面中心对齐(是的,我查看了其他答案,我无法让它工作)