button_to(“delete”,:confirm)不会弹出并立即执行delete方法

时间:2013-08-21 15:35:43

标签: javascript ruby-on-rails-3 confirm button-to

我已经调查了这个,它可能与我的javascript配置有关,但不确定我在这里缺少什么:

视图

 <%= button_to("Delete Collection", @collection, :confirm => "Really delete bundle and all its examples?", :method => :delete) %>

Javascript角/ application.js中

//= require jquery
//= require jquery_ujs
//= require_tree .

布局/ application.html.erb

<head>
  <title>Portfolio</title>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= javascript_include_tag :defaults %>
  <%= csrf_meta_tags %>
</head>

0 个答案:

没有答案