From fe93a9c2c54075ad446284db94e61f0ee6891e23 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 27 Nov 2014 15:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=BB=E9=A1=B5=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=96=99=E6=95=B0=E4=B8=BA?= =?UTF-8?q?0=EF=BC=8C=E5=88=99=E5=8F=96=E6=B6=88=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/_course_list.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb index 8d0d6c40d..da6c0fbf0 100644 --- a/app/views/welcome/_course_list.html.erb +++ b/app/views/welcome/_course_list.html.erb @@ -25,8 +25,10 @@ <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %> <% end %> (<%= course.members.count %>人) - <%# files_count = course.attachments.count.to_s %> - (<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料) + <% files_count = course.attachments.count %> + <% if files_count > 0%> + (<%= link_to "#{files_count.to_s}份", course_files_path(course) %>资料) + <% end %> <% end %>