我现在使用ckeditor gem已经有一段时间了,我只是注意到如果我更改了我的config.js,它实际上并没有改变浏览器中的任何内容。我在那里做了很多改变,直到现在它都运行良好。突然之间,如果我改变任何东西,它会使用必须在某处缓存的旧文件。
我尝试删除预编译资产并重新预编译,删除浏览器上的缓存...
这是一个宝石问题,还是我错过了什么?
我的config.js:
CKEDITOR.editorConfig = function( config )
{
config.extraPlugins = 'symbol,mathjax,widget,lineutils,mark_code,simpleuploads,help_me';
config.scayt_autoStartup = true;
config.extraCss += "body{font-family:'lato', Georgia;}";
config.width = 'auto';
config.height = '300';
config.language = 'en';
config.magicline_everywhere=true;
config.allowedContent = true;
config.coreStyles_superscript = {
element: 'sup',
attributes: { 'style': 'vertical-align: top; font-size: 0.8em;' },
overrides: 'sup'
};
config.pasteFromWordPromptCleanup = true;
config.pasteFromWordRemoveFontStyles = true;
config.forcePasteAsPlainText = true;
config.ignoreEmptyParagraph = true;
config.removeFormatAttributes = true;
config.filebrowserImageUploadUrl = "/ckeditor/pictures";
config.filebrowserUploadUrl = "/ckeditor/attachment_files";
config.simpleuploads_maxFileSize = 6000000;
config.simpleuploads_acceptedExtensions = "jpe?g|png|gif|pdf|doc|docx|odt|ods|xls";
config.simpleuploads_imageExtensions = 'jpe?g|gif|png';
config.enterMode = CKEDITOR.ENTER_P;
config.format_tags = 'p';
config.toolbar =
[
{ name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','-','Subscript','Superscript' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Blockquote' ] },
{ name: 'insert', items : ['addImage','addFile','-','simple_links','simple_link_images','oembed','-','Symbol','Mathjax','mark_code'] },
{ name: 'other', items : ['help_me','Maximize'] }
];
};
CKEDITOR.on( 'dialogDefinition', function( ev )
{
ev.data.definition.resizable = CKEDITOR.DIALOG_RESIZE_NONE;
});
答案 0 :(得分:1)
我遇到了同样的问题。把
<script type="text/javascript">
CKEDITOR.timestamp = 'anything random';
</script>
在app.html.erb之前的包含标签为我解决了这个问题
答案 1 :(得分:0)
试试:
<script type="text/javascript">
CKEDITOR.timestamp = +new Date;
</script>