From 2d508254ac4c04e4bff29a4662b505a5b1357349 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 14 Oct 2016 16:16:35 +0800 Subject: [PATCH] =?UTF-8?q?51=E3=80=8194=E7=94=A8=E6=88=B7=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=BB=E9=A1=B5=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/praise_tread/_praise.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/praise_tread/_praise.html.erb b/app/views/praise_tread/_praise.html.erb index 26e5900aa..dfd1011db 100644 --- a/app/views/praise_tread/_praise.html.erb +++ b/app/views/praise_tread/_praise.html.erb @@ -2,12 +2,12 @@ <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> - <%= num > 0 ? "(#{num})" : "" %> + <%= (num.nil? ? 0 : num) > 0 ? "(#{(num.nil? ? 0 : num)})" : "" %> <% else %> 已赞 <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> - <%= num > 0 ? "(#{num})" : "" %> + <%= (num.nil? ? 0 : num) > 0 ? "(#{(num.nil? ? 0 : num)})" : "" %> <% end %> \ No newline at end of file