mirror of
https://github.com/zhigang1992/tsemple.git
synced 2026-01-12 22:53:00 +08:00
14 lines
257 B
Ruby
14 lines
257 B
Ruby
class FileUploader < CarrierWave::Uploader::Base
|
|
include CarrierWave::MiniMagick
|
|
|
|
storage :file
|
|
|
|
def store_dir
|
|
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
|
end
|
|
|
|
def extension_white_list
|
|
%w(jpg jpeg gif png)
|
|
end
|
|
end
|