CKEditor gem (https://github.com/galetahub/ckeditor)과 함께 CKEditor를 사용하고 있으며 사용자 지정 도구 모음을 추가 할 때까지 모든 것이 올바르게 작동합니다.레일의 CKEditor에 사용자 지정 도구 모음 추가
내가 본 일부 게시물은 config.js 파일 사용을 제안합니다. 그러나 지침에 따라 설정하면 app/assets/javascripts
에 /ckeditor/config.js
파일이 없습니다. 또한 /ckeditor/config.js
을 javascript 디렉토리에 추가하면 파일 업로드 기능이 작동하지 않습니다. config.js
이 빈 파일 인 경우에도 이런 문제가 발생합니다. '업로드'탭은 서버를 재부팅 할 때 숨겨져 작동하지 않게됩니다.
도구 모음을 보편적으로 사용자 정의 할 수있는 방법이 있습니까? 난 그냥 레일 3.2.11 내 Gemfile에
을 사용하여 도움이 될 것입니다 뭔가 ...
인라인 옵션을 쌍 또는 수없는 경우에도 아니면 내가 가지고
gem "jquery-rails", "~> 2.2.1"
gem "ckeditor"
gem "carrierwave"
gem "mini_magick"
gem "cloudinary"
에서 application.rb 내가 가진 : 응용 프로그램에서
config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
합니다. JS 내가 가진 : 내 양식에
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require ckeditor/init
//= require_tree ../../../vendor/assets/javascripts/.
//= require_tree .
내가 가진 :
CKEDITOR.editorConfig = function(config) {
config.toolbar_Custom = [
{ name: 'document', items : [ 'Source','-','Save','NewPage','DocProps','Preview','-','Templates' ] },
{ name: 'clipboard', items : [ 'PasteFromWord','-','Undo','Redo' ] },
{ name: 'insert', items : [ 'Image','Table','HorizontalRule','SpecialChar','PageBreak' ] },
{ name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] },
'/',
{ name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
{ name: 'links', items : [ 'Link','Unlink','Anchor' ] },
'/',
{ name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
{ name: 'colors', items : [ 'TextColor','BGColor' ] }
];
config.toolbar = 'Custom';
};