$('#project_form').replaceWith('<%= j render 'form', :project => @project, :remote => true %>');

if (($('#project_modal').data('bs.modal') || { isShown: false }).isShown == false) {
  $('#project_modal').modal('show');
}

$('#project_modal #project_form').replaceWith('<%= j render 'form', :project => @project, :remote => true %>');

if (($('#project_modal').data('bs.modal') || { isShown: false }).isShown == false) {
  $('#project_modal').modal('show');
}

Fix javascript new form replacing while editing project
Fix javascript new form replacing while editing project
