Class: Spotlight::AvatarUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Spotlight::AvatarUploader
- Includes:
- CarrierWave::MiniMagick
- Defined in:
- app/uploaders/spotlight/avatar_uploader.rb
Overview
Exhibit contact profile pictures
Instance Method Summary collapse
- #default_url ⇒ Object
-
#store_dir ⇒ Object
Override the directory where uploaded files will be stored.
Instance Method Details
#default_url ⇒ Object
20 21 22 |
# File 'app/uploaders/spotlight/avatar_uploader.rb', line 20 def default_url ActionController::Base.helpers.image_path('spotlight/fallback/' + [version_name, 'default.png'].compact.join('_')) 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:
16 17 18 |
# File 'app/uploaders/spotlight/avatar_uploader.rb', line 16 def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end |