Home  >  Q&A  >  body text

ruby - rails3 link_to :method => :delete,:confirm=>"are you srue?" 不起作用是为什么?

如下 代码:

ink_to :Delete,{:action => :delete,:obj_id => obj_id,:table =>params[:table]},:class => "negative button",:method => :delete,:confirm => "are you sure Delte #{params[:table]}: #{obj_id} ?"

在rails2.X中当我点击 这个链接的时候会弹出一个提醒框,然后升级到rails 3.2中就不好使了。这个是为什么?有什么解决的方法吗?

黄舟黄舟2762 days ago770

reply all(2)I'll reply

  • 阿神

    阿神2017-04-21 10:58:02

    Need to import some js files
    Introduce "jquery-ujs.js" into application.html.erb

    reply
    0
  • PHPz

    PHPz2017-04-21 10:58:02

    It is recommended to enable javascript script debugging such as firebug in the browser to find out whether there is an error in some front-end code that prevents the function from executing properly.

    reply
    0
  • Cancelreply