From 64e68ff8a02b11198f26684f6030fb49ded683b2 Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 4 Apr 2014 15:58:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E9=A1=B9=E7=9B=AE=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=98=BE=E7=A4=BA=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/users/show.html.erb | 2 ++ app/views/users/watch_projects.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 6ce5e2095..541fa67ed 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -20,6 +20,8 @@ <% unless @activity.empty? %>
<% @activity.each do |e| %> + <%# 以下一行代码解决有未知的活动无法转换成Model报错%> + <% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next; ) if e.act_type.safe_constantize.nil? %> <% act = e.act %> <% unless act.nil? %> diff --git a/app/views/users/watch_projects.html.erb b/app/views/users/watch_projects.html.erb index 137fc21fb..69c7e09da 100644 --- a/app/views/users/watch_projects.html.erb +++ b/app/views/users/watch_projects.html.erb @@ -3,7 +3,7 @@ <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> <% end %> <%= watch_projects @state%> -<% if @watch_projects.nil?&&watch_projects.project.nil? %> +<% if @watch_projects.count > 0 %> <% for watch_project in @watch_projects %>
@@ -11,7 +11,7 @@
- +
<%= link_to_user(@user) if watch_project.respond_to?(:user) %> <%= @user.name%><%= l(:label_watch_project) %> <%= link_to_project(watch_project.project) %> <%= link_to_user(@user) if watch_project.respond_to?(:user) %> <%= link_to_project(watch_project.project) %>