Class: Kuhsaft::AssetBrickAssetUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Kuhsaft::AssetBrickAssetUploader
- Defined in:
- app/uploaders/kuhsaft/asset_brick_asset_uploader.rb
Instance Method Summary collapse
-
#extension_white_list ⇒ Object
Add a white list of extensions which are allowed to be uploaded.
-
#store_dir ⇒ Object
Override the directory where uploaded files will be stored.
Instance Method Details
#extension_white_list ⇒ Object
Add a white list of extensions which are allowed to be uploaded. For images you might use something like this:
34 35 36 |
# File 'app/uploaders/kuhsaft/asset_brick_asset_uploader.rb', line 34 def extension_white_list %w(pdf doc docx xls xlsx ppt pptx) end |
#store_dir ⇒ Object
Override the directory where uploaded files will be stored. This is a sensible default for uploaders that are meant to be mounted:
15 16 17 18 |
# File 'app/uploaders/kuhsaft/asset_brick_asset_uploader.rb', line 15 def store_dir model_identifier = model.class.name.underscore.gsub(/^kuhsaft/, 'cms') "uploads/#{model_identifier}/#{mounted_as}/#{model.id}" end |