Class: Addressbook::PhotoUploader

Inherits:
BaseUploader
  • Object
show all
Includes:
CarrierWave::MiniMagick
Defined in:
lib/addressbook/photo_uploader.rb

Instance Method Summary collapse

Methods inherited from BaseUploader

#cache_dir, #initialize, #store_dir

Constructor Details

This class inherits a constructor from Addressbook::BaseUploader

Instance Method Details

#extension_white_listObject

Add a white list of extensions which are allowed to be uploaded. For images you might use something like this:



22
23
24
# File 'lib/addressbook/photo_uploader.rb', line 22

def extension_white_list
  %w(jpg jpeg gif png)
end

#scale(width, height) ⇒ Object

Process files as they are uploaded: process :scale => [1200, 300]



11
12
13
# File 'lib/addressbook/photo_uploader.rb', line 11

def scale(width, height)
  resize_to_fill(width, height)
end