<%=link_to "Delete", :action => 'destroy_password', :id => p.id, :job => @job, data: {confirm:'Are you sure you want to delete this password?'} %>
此链接删除数据但不提示确认。任何想法为什么确认不起作用?这是Rails 4
它将数据作为URL中的参数传递。
答案 0 :(得分:5)
<%=link_to "Delete", {:action => 'destroy_password', :id => p.id, :job => @job},:method => :delete ,data: {confirm:'Are you sure you want to delete this password?'} %>