Bulk renaming of files
Rename the files in a directory by replacing a space with an underscore. The rename program comes with most modern Linux distros.
rename 's/\ /_/g' *.*
Rename the files in a directory by replacing a space with an underscore. The rename program comes with most modern Linux distros.
rename 's/\ /_/g' *.*
class ProductImageUploader < CarrierWave::Uploader::Base
def store_dir
"product"
end
def filename
ext = File.extname(original_filename) if original_filename
"#{model.name.parameterize}#{ext}"
end
end