diff --git a/app/views/users/_watch_btn_for_picture.html.erb b/app/views/users/_watch_btn_for_picture.html.erb index be8673468..50f9b6240 100644 --- a/app/views/users/_watch_btn_for_picture.html.erb +++ b/app/views/users/_watch_btn_for_picture.html.erb @@ -2,8 +2,8 @@ <%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") %> <% else %> <%if(user.watched_by?(User.current))%> - <%= link_to "取消关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%> + <%= link_to "取消关注",watch_path(:host=> Setting.host_name,:object_type=> 'user',:object_id=>user.id.to_s,:target_id=>user.id.to_s),:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%> <% else %> - <%= link_to "添加关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%> + <%= link_to "添加关注",watch_path(:host=> Setting.host_name,:object_type=> 'user',:object_id=>user.id.to_s,:target_id=>user.id.to_s),:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%> <% end %> <% end %> \ No newline at end of file