 
   if EffectiveForm.remote_form_flash.length > 0
     flash = EffectiveForm.remote_form_flash[0]
-    $table.DataTable().flash(flash[1], flash[0]).draw()
-  else
-    $table.DataTable().flash('Successfully ' + $action.attr('title'), 'success').draw()
-
-  refreshDatatables($table)
+    $table.DataTable().flash(flash[1], flash[0])
+  else
+    $table.DataTable().flash('Successfully ' + $action.attr('title'), 'success')
+
+  unless redirectDatatables($table)
+    $table.DataTable().draw()
+    refreshDatatables($table)
 
 buildRow = (length, payload) ->
   "<td class='col-inline-form' colspan='#{length-1}'><div class='container'>#{payload}</div></td>" +

  if $wrapper.find('.effective-datatables-inline-row').length == 0
    $wrapper.removeClass('effective-datatables-inline-expanded')

refreshDatatables = ($source) ->
  return unless EffectiveForm.remote_form_refresh_datatables.length > 0


  $table = $tr.closest('table')

  if $tr.hasClass('effective-datatables-new-resource')
    $table.DataTable().flash(flash || 'Item created', 'success')
    $tr.fadeOut('slow')

    $actions = $table.children('thead').find('th.col-actions')
    $actions.children('svg').remove()
    $actions.children('a').fadeIn()
  else
    $table.DataTable().flash(flash || 'Item updated', 'success')
    $tr.fadeOut('slow')

  unless redirectDatatables($table)
    $table.DataTable().draw()
    refreshDatatables($table)

beforeNew = ($action) ->
  $table = $action.closest('table')
