Class: Uploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Uploader
- Includes:
- CarrierWave::MiniMagick
- Defined in:
- lib/padrino-cms/lib/uploader.rb
Overview
require ‘carrierwave/processing/rmagick’
Instance Method Summary collapse
-
#cache_dir ⇒ Object
Directory where uploaded temp files will be stored (default is [root]/tmp).
-
#default_url ⇒ Object
Default URL as a default if there hasn’t been a file uploaded.
-
#file ⇒ Object
Storage type.
-
#root ⇒ Object
Manually set root.
-
#store_dir ⇒ Object
Directory where uploaded files will be stored (default is /public/uploads).
-
#thumb ⇒ Object
Create different versions of your uploaded files.
Instance Method Details
#cache_dir ⇒ Object
Directory where uploaded temp files will be stored (default is [root]/tmp)
39 40 41 |
# File 'lib/padrino-cms/lib/uploader.rb', line 39 def cache_dir Padrino.root("tmp") end |
#default_url ⇒ Object
Default URL as a default if there hasn’t been a file uploaded
46 47 48 |
# File 'lib/padrino-cms/lib/uploader.rb', line 46 def default_url "/images/" + [version_name, "default.png"].compact.join('_') end |
#file ⇒ Object
Storage type
13 |
# File 'lib/padrino-cms/lib/uploader.rb', line 13 storage :file |
#root ⇒ Object
Manually set root
27 |
# File 'lib/padrino-cms/lib/uploader.rb', line 27 def root; File.join(Padrino.root, "public/"); end |
#store_dir ⇒ Object
Directory where uploaded files will be stored (default is /public/uploads)
32 33 34 |
# File 'lib/padrino-cms/lib/uploader.rb', line 32 def store_dir 'images/uploads' end |
#thumb ⇒ Object
Create different versions of your uploaded files
58 59 60 |
# File 'lib/padrino-cms/lib/uploader.rb', line 58 version :thumb do process :resize_to_fill => [60, 60] end |