Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordanhudgens/426fd0525d394ce4a4ee to your computer and use it in GitHub Desktop.
Save jordanhudgens/426fd0525d394ce4a4ee to your computer and use it in GitHub Desktop.
# 1) Add to your root .js file (like application.js):
//= require ckeditor/override
//= require ckeditor/init
#2) Create new .rake task in this code to your "lib" folder:
namespace :ckeditor do
desc 'Create nondigest versions of some ckeditor assets (e.g. moono skin png)'
task :create_nondigest_assets do
fingerprint = /\-[0-9a-f]{32}\./
for file in Dir['public/assets/ckeditor/contents-*.css', 'public/assets/ckeditor/skins/moono/*.png']
next unless file =~ fingerprint
nondigest = file.sub fingerprint, '.' # contents-0d8ffa186a00f5063461bc0ba0d96087.css => contents.css
FileUtils.cp file, nondigest, verbose: true
end
end
end
# auto run ckeditor:create_nondigest_assets after assets:precompile
Rake::Task['assets:precompile'].enhance do
Rake::Task['ckeditor:create_nondigest_assets'].invoke
end
# to copy non-digest copies of CKeditor files after assets:precompile on deploying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment