<%= submit_tag "Delete" , :confirm => 'Are y开发者_运维百科ou sure you want to delete the selected?' %>
doesn't work.
how do I do this?
Try this :
<%= submit_tag "Delete", data: { confirm: 'Are you sure you want to delete the selected?' }%>
It should work. Most likely you didn't include necessary JavaScript files. Do you have something like this in your HTML head tag?
<%= javascript_include_tag :defaults %>
I found this solution and it works to me.
<%= submit_tag 'Save', onclick: "return confirm('Are you sure?')" %>
The Solution link is Here
Thanks
精彩评论