Ruby on rails 3 Rails 3:脚手架销毁操作重定向到显示操作

Ruby on rails 3 Rails 3:脚手架销毁操作重定向到显示操作,ruby-on-rails-3,action,scaffold,Ruby On Rails 3,Action,Scaffold,我创建了一个简单的scaffold,问题是当我尝试删除一条记录时,单击destroy rails重定向到show操作,这是我生成scaffold时自动生成的链接代码: <%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %> “你确定吗?”,:method=>:delete%> 怎么了?您需要在应用程序布局中包含rails.js,因为此链接要求js使用正确的H

我创建了一个简单的scaffold,问题是当我尝试删除一条记录时,单击destroy rails重定向到show操作,这是我生成scaffold时自动生成的链接代码:

<%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %> 
“你确定吗?”,:method=>:delete%>

怎么了?

您需要在应用程序布局中包含
rails.js
,因为此链接要求js使用正确的HTTP方法。还要确保布局中有
csrf\u meta\u标记。

检查
application.js
是否有
/=require jquery\u ujs
添加
application.js
此代码

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .

好的,谢谢现在jquery库和其他js文件都被注释了,销毁操作也可以正常工作,但是我怎样才能将jquery和prototype合并在一起而不发生冲突呢?