ruby -- 问题解决(六)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

posted @ 2013-09-04 14:11  lmei  阅读(437)  评论(0编辑  收藏  举报