我不想在我的Rails-App中使用CKEditor。rails 4如何配置ckeditor 4.1
在我的Gemfile我加入这一行
gem 'ckeditor', :git => 'https://github.com/galetahub/ckeditor.git'
后,我跑“捆绑更新”和“轨产生的CKEditor:安装--orm = active_record --backend =回形针”我添加到我的application.js这条线:
//= require ckeditor/init
在我看来
我加入这一行:
<%= f.cktext_area :img, :ckeditor => {:toolbar => 'img', :customConfig => asset_path('ckeditor/config.js')} %>
我创造了这个文件夹和网络连接莱:
/app/assets/javascripts/ckeditor
/app/assets/javascripts/ckeditor/config.js
/app/assets/javascripts/ckeditor/contents.css
我config.js看起来是这样的:
CKEDITOR.editorConfig = function(config)
{
config.toolbar_img = [
{ name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] },
]
}
为什么我的编辑器看起来像这样?
什么是你希望它是什么? – Surya 2014-10-30 17:54:04
为什么它有这么多工具栏?我不想只有新建页面和预览按钮:) – Evolutio 2014-10-30 17:56:00
CKEditor中的'New Page'和'Preview button'在哪里?你能发布链接到你的代码中添加的文档配置吗? – Surya 2014-10-30 18:00:19