How to delete the original files and keep only the versions using CarrierWave?
问题 I'm trying this but without luck. class FileUploader < CarrierWave::Uploader::Base after :cache, :unlink_original def unlink_original(file) file.delete end . . end 回答1: Figured it out. There was a typo in the docs. Fixed it with the following. class FileUploader < CarrierWave::Uploader::Base after :store, :unlink_original def unlink_original(file) File.delete if version_name.blank? end . . end 来源: https://stackoverflow.com/questions/9557911/how-to-delete-the-original-files-and-keep-only-the