Checkbox alert working when click handler is in application.js