我已经在我的Rails 3.1应用程序上成功地从
https://github.com/galetahub/ckeditor配置了ckeditor gem.我现在的问题是,我不知道如何配置CKEditor.根据自述文件使用的文件根本不存在于启用资产管道的Rails 3.1应用程序中.
解决方法
答案很简单,一旦我弄清了抛出的错误信息.
/应用/资产/ JavaScript的/ CKEditor的
CKEDITOR.editorConfig = function( config ) { config.toolbar_MyToolbar = [ { name: 'document',items : [ 'NewPage','Preview' ] },{ name: 'clipboard',items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },{ name: 'editing',items : [ 'Find','Replace','SelectAll','Scayt' ] },{ name: 'insert',items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe' ] },'/',{ name: 'styles',items : [ 'Styles','Format' ] },{ name: 'basicstyles',items : [ 'Bold','Italic','Strike','RemoveFormat' ] },{ name: 'paragraph',items : [ 'NumberedList','BulletedList','Outdent','Indent','Blockquote' ] },{ name: 'links',items : [ 'Link','Unlink','Anchor' ] },{ name: 'tools',items : [ 'Maximize','About' ] } ]; }
这是重要的部分,在ckeditor的require之后放置require_tree(包括ckeditor / config.js):
/app/assets/javascript/application.js
//= require jquery //= require jquery_ujs //= require ckeditor/ckeditor //= require_tree .