公共贴吧 顶和踩之后数字未变化
This commit is contained in:
parent
c2d41ab8db
commit
76247d74a7
|
@ -20,9 +20,9 @@ module PraiseTreadHelper
|
|||
# when 0
|
||||
# return @record.tread_num.nil? ? 0 : @record.tread_num
|
||||
# end
|
||||
return (@record.praise_num.to_i-@record.tread_num.to_i)
|
||||
return ((@record.praise_num.nil? ? 0 : @record.praise_num.to_i)-(@record.tread_num.nil? ? 0 : @record.tread_num.to_i))
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<div class="lz">
|
||||
<!-- 在这里添加赞和踩-->
|
||||
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
|
||||
<span id="praise_tread" style="float: right">
|
||||
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
|
||||
</span>
|
||||
<div class="lz-left">
|
||||
<div>
|
||||
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
|
||||
|
|
Loading…
Reference in New Issue