I am having in my view 4 buttons implemented in coffescript , here is the view
%button#warn.button{:type => "submit"}
Warn
%button#ban.button{:type => "submit"}
Ban
%button#delete.button{:type => "submit"} ,
Delete
%button#hide.button{:type => "submit"}
Hide
In the js.coffee file , this is what I wrote
$(document).ready ->
$("#warn").click ->
target = "check_warned"
$("#needs_form").attr "action", target
$("#needs_form").submit()
$("#ban").click ->
target = "ban "
$("#needs_form").attr "action", target
$("#needs_form").submit()
$("#delete").click ->
target = " delete "
$("#needs_form").attr "action", target
$("#needs_form").submit()
$("#hide").click ->
target = " hide "
$("#needs_form").attr "action", target
$("#needs_form").submit()
Now I need to add a confirmation pop up with “Are you sure you want to delete these posts?” when I click on the delete button.. Any help about how to embed it in this code?
in your delete click function: