|
|
|
@ -130,15 +130,15 @@ module ApplicationHelper
|
|
|
|
|
if source.class.to_s == 'User'
|
|
|
|
|
File.join(relative_path, ["#{source.class}", "#{source.id}"])
|
|
|
|
|
else
|
|
|
|
|
File.join("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"
|
|
|
|
|
File.join(relative_path, "#{source.class}", str)
|
|
|
|
|
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'
|
|
|
|
|
File.join("educoder","index", "shixun", "shixun#{rand(23)}.jpg")
|
|
|
|
|
File.join("images","educoder", "index", "shixun", "shixun#{rand(23)}.jpg")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|