Here is my rails link_to
<%= link_to 'Delete',url_for(action: :delete,id: @user.id),data: {confirm: "Are you sure?"} %>
I tried the above method but it is directly deleting without any alert message. What wrong I made. Can any one correct it.
Try this
<%= link_to 'Delete',url_for(action: :delete,id: @user.id),method: :delete, data: {confirm: "Are you sure?"} %>
1.4m articles
1.4m replys
5 comments
57.0k users