Skip to content

Instantly share code, notes, and snippets.

@stevenbristol
Created July 18, 2012 12:10
Show Gist options
  • Save stevenbristol/3135824 to your computer and use it in GitHub Desktop.
Save stevenbristol/3135824 to your computer and use it in GitHub Desktop.
$.rails.showConfirmDialog = (link) ->
html = """
<div id="dialog-confirm" title="Are you sure you want to delete?">
<p>These item will be permanently deleted and cannot be recovered. Are you sure?</p>
</div>
"""
$(html).dialog
resizable: false
modal: true
buttons:
OK: ->
$.rails.confirmed link
$(this).dialog "close"
Cancel: ->
$(this).dialog "close"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment