修改英雄版为0显示的问题

This commit is contained in:
huang 2015-11-30 15:42:00 +08:00
parent aefab8abf3
commit 582a7c47a4
1 changed files with 2 additions and 2 deletions

View File

@ -240,11 +240,11 @@
<% end %>
<% hero_homework_scores = hero_homework_score(@course, "desc") %>
<% unless hero_homework_scores.map(&:score).detect{|s| s != nil}.nil? %>
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
<ul class="rankList">
<h4>课程英雄榜</h4>
<% hero_homework_scores.each do |student_score| %>
<% unless student_score.score.nil? %>
<% if student_score.score.to_i != 0 %>
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
<p><a href="javascript:void:(0);"><%=link_to student_score.user, user_path(student_score.user), :title => student_score.user %></a></p>
<p><span class="c_red" style="cursor:pointer" title="作业总分:<%= student_score.score %>"><%= student_score.score.to_i %></span></p>