Class: BoltonCms::AttachmentUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- BoltonCms::AttachmentUploader
- Includes:
- CarrierWave::MimeTypes, CarrierWave::MiniMagick
- Defined in:
- lib/bolton_cms/attachment_uploader.rb
Instance Method Summary collapse
- #cache_dir ⇒ Object
- #dyn_resize_fill(options) ⇒ Object
- #dyn_resize_fit(options) ⇒ Object
- #dyn_resize_limit(options) ⇒ Object
- #dyn_resize_pad(options) ⇒ Object
- #extension_white_list ⇒ Object
- #store_dir ⇒ Object
Instance Method Details
#cache_dir ⇒ Object
11 12 13 |
# File 'lib/bolton_cms/attachment_uploader.rb', line 11 def cache_dir "#{Padrino.root}/public/#{mounted_as}-cache" end |
#dyn_resize_fill(options) ⇒ Object
45 46 47 |
# File 'lib/bolton_cms/attachment_uploader.rb', line 45 def dyn_resize_fill() resize_to_fill ['width'], ['height'], model.gravity end |
#dyn_resize_fit(options) ⇒ Object
41 42 43 |
# File 'lib/bolton_cms/attachment_uploader.rb', line 41 def dyn_resize_fit() resize_to_fit ['width'], ['height'] end |
#dyn_resize_limit(options) ⇒ Object
37 38 39 |
# File 'lib/bolton_cms/attachment_uploader.rb', line 37 def dyn_resize_limit() resize_to_limit ['width'], ['height'] end |
#dyn_resize_pad(options) ⇒ Object
49 50 51 |
# File 'lib/bolton_cms/attachment_uploader.rb', line 49 def dyn_resize_pad() resize_and_pad ['width'], ['height'], (['background'] || :transparent), model.gravity end |
#extension_white_list ⇒ Object
16 17 18 |
# File 'lib/bolton_cms/attachment_uploader.rb', line 16 def extension_white_list %w(jpg jpeg gif png) end |
#store_dir ⇒ Object
8 9 10 |
# File 'lib/bolton_cms/attachment_uploader.rb', line 8 def store_dir "#{Padrino.root}/public/#{mounted_as}/#{model.page.id}" end |