课程主页,如课程资料数为0,则取消显示

This commit is contained in:
sw 2014-11-27 15:39:57 +08:00
parent 2b5160f2d9
commit fe93a9c2c5
1 changed files with 4 additions and 2 deletions

View File

@ -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 %>
</div>
</li>
<% end %>