Class: Xhive::ImageUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Xhive::ImageUploader
- Includes:
- CarrierWave::MiniMagick, Sprockets::Helpers::IsolatedHelper, Sprockets::Helpers::RailsHelper
- Defined in:
- app/uploaders/xhive/image_uploader.rb
Instance Method Summary collapse
-
#cache_dir ⇒ Object
For heroku read-only filesystem.
- #default_url ⇒ Object
- #extension_white_list ⇒ Object
- #store_dir ⇒ Object
- #url ⇒ Object
Instance Method Details
#cache_dir ⇒ Object
For heroku read-only filesystem
31 32 33 |
# File 'app/uploaders/xhive/image_uploader.rb', line 31 def cache_dir "#{Rails.root}/tmp/uploads" end |
#default_url ⇒ Object
14 15 16 |
# File 'app/uploaders/xhive/image_uploader.rb', line 14 def default_url asset_path "fallback/" + [version_name, "default.png"].compact.join('_') end |
#extension_white_list ⇒ Object
26 27 28 |
# File 'app/uploaders/xhive/image_uploader.rb', line 26 def extension_white_list %w(jpg jpeg gif png) end |
#store_dir ⇒ Object
10 11 12 |
# File 'app/uploaders/xhive/image_uploader.rb', line 10 def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end |
#url ⇒ Object
18 19 20 |
# File 'app/uploaders/xhive/image_uploader.rb', line 18 def url super.gsub('+', '%2B') end |