dev_admin
cxt 6 years ago
parent 7f591bd4b2
commit 1fa5ba918a

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

Loading…
Cancel
Save