<% if @error %>
  toastr.error("<%= @error_message %>")
<% else %>
  toastr.success('Record has been successfully created.');
  $(".data-table").DataTable().ajax.reload();
  $('.table--add-record-modal').removeClass('show');
  $('.table--add-record-modal').addClass('hide');
<% end %>
