Rails 4 Asset Pipeline: Compile both with and without fingerprint

女生的网名这么多〃 提交于 2019-12-06 09:19:21

I've written a rake task to get the un-fingerprinted files à la Rails 3.2 back:

namespace :assets do
  desc "Create symlinks without cache busting digest"
  task :create_symlinks_without_digest => :environment do
    Dir.glob(Rails.root.join('public', 'assets', '**', '*')).each do |item|
      if File.file?(item) && item.match(/-[a-f0-9]{32}/)
        FileUtils.ln_s Pathname(item).basename, item.sub(/-[a-f0-9]{32}/, '')
      end
    end
  end
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!