<%= link_to "Follow", { :controller => "friendship", :action => "follow",:id=> friend.id} , :remote => true, :class => "follow_user" %>
答案 0 :(得分:1)
尝试
<%= button_to "Follow", { controller: "friendship", action: "follow", id: friend.id}, remote: true, class: "follow_user", method: :post %>
答案 1 :(得分:0)
method: :post
添加到您的link_to
选项。request.post?
请求是否为POST。