Carrierwave recommends overriding store_dir
in the uploader, but it only gives you a way to modify the directory name, not the whole path with the file name. Overriding store_path
let's you modify the entire path.
def store_path(for_file = filename)
self.model.class.name.underscore.pluralize + "/" + self.model.slug + "/" + (version_name || :original).to_s + ".jpg"
end
This is the original:
def store_path(for_file=filename)
File.join([store_dir, full_filename(for_file)].compact)
end
So this changes the path of where the uploaded file will be saved in the file system, not the slug to acces the file via http?