图片url调整

dev_course
cxt 6 years ago
parent cc1d09bee7
commit 9ca32a6d1a

@ -128,7 +128,7 @@ module ApplicationHelper
if source.class.to_s == 'User'
File.join(relative_path, ["#{source.class}", "#{source.id}"])
else
File.join("/images/avatars", ["#{source.class}", "#{source.id}"])
File.join("images/avatars", ["#{source.class}", "#{source.id}"])
end
elsif source.class.to_s == 'User'
str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g"
@ -146,7 +146,7 @@ module ApplicationHelper
def shixun_url_to_avatar(shixun)
if File.exist?(disk_filename(shixun.class, shixun.id))
File.join("/images/#{relative_path}", "#{shixun.class}", "#{shixun.id}")
File.join("images/#{relative_path}", "#{shixun.class}", "#{shixun.id}")
else
File.join("educoder", "index", "shixun", "shixun#{rand(23)}.jpg")
end

Loading…
Cancel
Save