$ -> $.rails.allowAction = (link) -> return true unless link.attr('data-confirm') $.rails.showConfirmDialog(link) false $.rails.confirmed = (link) -> link.removeAttr('data-confirm') link.trigger('click.rails') $.rails.showConfirmDialog = (link) -> message = link.attr 'data-confirm' html = """ """ $(html).modal() $('#confirmationDialog .confirm').on 'click', -> $.rails.confirmed(link)