Rails --link_to to destroy not working

    Rails --link_to to destroy not working

在Rails的development环境下开发时,使用link_to进行destroy时顺利进行,最近将环境配置成production时,使用link_to,结果not working

代码如下:

<%= link_to 'Delete User', @user, :confirm => "Are you sure you want to delete?", :method => :delete, :class => "btn btn-danger %>

解决方法如下:将link_to 改为 button_to

<%= button_to 'Delete User', @user, :confirm => "Are you sure you want to delete?", :method => :delete, :class => "btn btn-danger %>

参考链接:http://stackoverflow.com/questions/4606860/rails-3-link-to-to-destroy-not-working

你可能感兴趣的:(Rails)