首页:如图关注列表中添加关注、取消关注后关注数统计未自动刷新

This commit is contained in:
cxt 2016-12-17 10:20:08 +08:00
parent e29eb67f68
commit d6c51cce2a
2 changed files with 3 additions and 1 deletions

View File

@ -143,7 +143,7 @@
<li>
<a href="<%= user_watchlist_user_path(@user) %>">
<strong>关注</strong><br />
<span class="sy_cgrey"><%= User.watched_by(@user).count %></span>
<span class="sy_cgrey" id="user_watchers_number"><%= User.watched_by(@user).count %></span>
</a>
</li>
<li>

View File

@ -14,6 +14,8 @@
$("#fans_user_number_div").html('<%= escape_javascript ( link_to User.find(params[:target_id]).watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>params[:target_id]},:class=>"homepageImageNumber", :id => "user_fans_number") %>');
$("#fans_span").html('<%= count %>');
$("#watch_span").html('<%= count %>');
$("#user_watchers_number").html('<%= User.watched_by(User.current).count %>');
$("#user_fans_number").html('<%= User.current.watcher_users.count %>');
//在其他用户的粉丝、关注页面
<% else %>
$("#users_list").html("<%= escape_javascript (render :partial => 'users/user_fans_item', :locals => {:list => list,:target=>User.find(params[:target_id]),:action_name=>action_name,:page=>params[:page]}) %>");