Skip to content

Instantly share code, notes, and snippets.

@agungyuliaji
Created October 27, 2014 07:43
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 agungyuliaji/f67359809351cce34d8f to your computer and use it in GitHub Desktop.
Save agungyuliaji/f67359809351cce34d8f to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment