用户关注ajax刷新

This commit is contained in:
ouyangxuhua 2015-08-29 11:34:27 +08:00
parent 5ce5fa218f
commit 1957100062
1 changed files with 6 additions and 2 deletions

View File

@ -30,9 +30,13 @@
<a href="<%= url_for(:controller => 'my', :action => 'account') %>" class="fr gz_btn mr10 ">编辑资料</a>
<%else%>
<%if(user.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消关注</a>
<a id="user_watch_id" href="javascript:void(0);">
<%=link_to "取消关注", watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id, :remote => "true"), :class => "fr qx_btn mr10", :method => "delete", :title => "取消关注" %>
</a>
<% else %>
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>user.id,:target_id=>user.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">添加关注</a>
<a id="user_watch_id" href="javascript:void(0);">
<%= link_to "添加关注", watch_path(:object_type=>'user',:object_id=>user.id,:target_id=>user.id, :remote => "true"), :class => "fr gz_btn mr10", :method => "post", :title => "添加关注" %>
</a>
<% end %>
<% end%>
<% end %>