ActiveAdmin.modal_dialog = (message, inputs, callback)-> html = """
" form = $(html).appendTo('body') $('body').trigger 'modal_dialog:before_open', [form] form.dialog modal: true open: (event, ui) -> $('body').trigger 'modal_dialog:after_open', [form] dialogClass: 'active_admin_dialog' buttons: OK: -> callback $(@).serializeObject() $(@).dialog('close') Cancel: -> $(@).dialog('close').remove()