问题
I am using the ckeditor gem for quite a while now and I just noticed that if I change my config.js it doesn't actually change anything in the browser. I made a lot of changes in there and it worked fine until now. All of the sudden if I change anything it uses the old files that must be cached somewhere.
I tried deleting precompiled assets and re-precompile them, deleting cache on the browser...
Is this a gem problem or am I just missing something?
My 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;
});
回答1:
I had the same problem. Putting
<script type="text/javascript">
CKEDITOR.timestamp = 'anything random';
</script>
in the application.html.erb before javascript include tags solved it for me
回答2:
Try that:
<script type="text/javascript">
CKEDITOR.timestamp = +new Date;
</script>
来源:https://stackoverflow.com/questions/27037284/ckeditor-gem-delete-cached-files