头像调整

dev_admin
cxt 6 years ago
parent 2ad274a59f
commit aeaf0a322f

@ -130,15 +130,15 @@ module ApplicationHelper
if source.class.to_s == 'User' if source.class.to_s == 'User'
File.join(relative_path, ["#{source.class}", "#{source.id}"]) File.join(relative_path, ["#{source.class}", "#{source.id}"])
else else
File.join("avatars", ["#{source.class}", "#{source.id}"]) File.join("images/avatars", ["#{source.class}", "#{source.id}"])
end end
elsif source.class.to_s == 'User' elsif source.class.to_s == 'User'
str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g" str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g"
File.join(relative_path, "#{source.class}", str) File.join(relative_path, "#{source.class}", str)
elsif source.class.to_s == 'Subject' elsif source.class.to_s == 'Subject'
File.join("educoder", "index", "subject", "subject#{rand(17)}.jpg") File.join("images","educoder", "index", "subject", "subject#{rand(17)}.jpg")
elsif source.class.to_s == 'Shixun' elsif source.class.to_s == 'Shixun'
File.join("educoder","index", "shixun", "shixun#{rand(23)}.jpg") File.join("images","educoder", "index", "shixun", "shixun#{rand(23)}.jpg")
end end
end end

Loading…
Cancel
Save