Rails UJS confirm box cancel button callback
问题 I am using Rails jquery ujs for handling ajax within my app. Also I am using a the confirm option for destroying any records. As my current setup, I have hooked up a loading overlay screen on click of data-remote=true link. All I wanted to know is: Is there a way I can hook a callback event when a user clicks cancel on the confirm box and I can close the loader overlay. 回答1: Yes, you can. Pass in the response object. In CoffeeScript. $('selector').on 'confirm:complete', (e, response) -> if