From a111b9a3fd0dd625cd2b89349ea9ba995132439f Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 29 Aug 2015 11:29:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=85=B3=E6=B3=A8ajax?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_show.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_show.html.erb b/app/views/users/_user_show.html.erb index 7cbb20e40..9eabb2be5 100644 --- a/app/views/users/_user_show.html.erb +++ b/app/views/users/_user_show.html.erb @@ -30,9 +30,13 @@ 编辑资料 <%else%> <%if(user.watched_by?(User.current))%> - 取消关注 + + <%=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 => "取消关注" %> + <% else %> - 添加关注 + + <%= 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 => "添加关注" %> + <% end %> <% end%> <% end %>