From 1fa5ba918a62494e3fc2d8c0508d211ce31e1757 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 2 Aug 2019 19:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7e9fd652b..ee0abd903 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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