From 4da8a3828f5c3a949b2b4745806d2e645a8eed99 Mon Sep 17 00:00:00 2001 From: linchun Date: Tue, 15 Mar 2016 09:47:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9C=80=E6=96=B0=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E4=BD=8D=E5=AE=8C=E6=88=90=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E7=82=B9=E5=87=BB=E6=9C=80=E5=90=8E=E4=B8=A4?= =?UTF-8?q?=E9=A1=B5=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/latest_login_users.html.erb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/admin/latest_login_users.html.erb b/app/views/admin/latest_login_users.html.erb index 82747eb7d..a9e8e2feb 100644 --- a/app/views/admin/latest_login_users.html.erb +++ b/app/views/admin/latest_login_users.html.erb @@ -92,13 +92,15 @@ <% end%> - <% if user.user_extensions.identity.to_i == 0 %> + <% unless user.user_extensions.nil? %> + <% if user.user_extensions.identity.to_i == 0 %> - <% occupation = user.user_extensions.school_id.nil? ? "" : (School.where("id =?", user.user_extensions.school_id)).first.try(:name) %> - <%= occupation.blank? ? user.user_extensions.occupation : occupation %> - <% else %> - <%= user.user_extensions.occupation %> - <% end %> + <% occupation = user.user_extensions.school_id.nil? ? "" : (School.where("id =?", user.user_extensions.school_id)).first.try(:name) %> + <%= occupation.blank? ? user.user_extensions.occupation : occupation %> + <% else %> + <%= user.user_extensions.occupation %> + <% end %> + <% end %> <% end %>