mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 18:39:52 +01:00
Add paperclip path to uploaders
This commit is contained in:
parent
76161029e8
commit
6f0d4971fb
2 changed files with 9 additions and 2 deletions
|
@ -11,6 +11,10 @@ class ProfileHeaderUploader < CarrierWave::Uploader::Base
|
||||||
"/system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
"/system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def paperclip_path
|
||||||
|
"users/:attachment/:id_partition/:style/:basename.:extension"
|
||||||
|
end
|
||||||
|
|
||||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||||
def default_url(*args)
|
def default_url(*args)
|
||||||
# For Rails 3.1+ asset pipeline compatibility:
|
# For Rails 3.1+ asset pipeline compatibility:
|
||||||
|
|
|
@ -11,13 +11,16 @@ class ProfilePictureUploader < CarrierWave::Uploader::Base
|
||||||
"/system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
"/system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def paperclip_path
|
||||||
|
"users/:attachment/:id_partition/:style/:basename.:extension"
|
||||||
|
end
|
||||||
|
|
||||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||||
def default_url(*args)
|
def default_url(*args)
|
||||||
# For Rails 3.1+ asset pipeline compatibility:
|
# For Rails 3.1+ asset pipeline compatibility:
|
||||||
# ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
# ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
||||||
|
|
||||||
"/images/
|
"/images/" + [version_name, "no_avatar.png"].compact.join('/')
|
||||||
" + [version_name, "no_avatar.png"].compact.join('/')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
version :large do
|
version :large do
|
||||||
|
|
Loading…
Reference in a new issue