Ruby Rails删除确认在销毁前不会弹出

问题描述

我正在尝试使用Rails destroy action和button_to从数据库删除一条记录,但是,不会弹出确认信息,该应用只是删除了该记录而未进行确认。我尝试了多种方法

<%= button_to 'Delete',post_path,:method => :delete,:confirm => 'Are you sure you want to delete this item?' %>

<%= button_to 'Delete',method: :delete,data: { confirm: 'Are you sure?' } %>

<%= button_to 'Delete',data: { confirm: 'Are you sure you want to delete this item?'}

<%= button_to 'Delete',{method: :delete},{confirm: 'Are you sure?'} %>

均未显示确认模块。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)