I''d like to add the :confirm option in the link_to_remote and replace
the missing confirm function with Facebook''s Dialogs.
function confirm(text) {
dlg = new Dialog(Dialog.DIALOG_CONTEXTUAL).showChoice(''Confirm
Request'', text , ''Yes'', ''No'');
dlg.onconfirm = function() { return true; };
dlg.oncancel = function() { return false; };
}
The above code doesn''t work because confirm needs to return true or
false as seen below:
if (confirm(''Really delete this record?'')) { new Ajax.Updater
...
So, is there a way to make the onconfirm event listener return true to
the confirm function so we can use the :confirm nicely in the
link_to_remote tags? Has anyone else found a different way to handle
this?