$("#ajax-modal").html("<%=j render(:partial => 'easy_documents/attachment_form', :locals => {:document => @document}) %>");

$('#ajax-modal').dialog({
  width: 550,
  modal: true,
  resizable: false,
  dialogClass: 'modal',
  title: '<%= l(:label_attachment_new) %>',
  zIndex: 0,
  open: function(event, ui) {
    setupFileDrop();
    EASY.utils.initFileUploads();
  },
  buttons: [{text: '<%=j l(:button_save) %>', click: function() {$(this).find('form').submit()}, 'class': 'button-positive'}]
});
