Destroy customer without flash notice

This commit is contained in:
Maikel Linke
2016-04-20 14:45:22 +10:00
parent 7bec139987
commit 23e598f2f8

View File

@@ -26,6 +26,23 @@ module Admin
end
end
# copy of Spree::Admin::ResourceController without flash notice
def destroy
invoke_callbacks(:destroy, :before)
if @object.destroy
invoke_callbacks(:destroy, :after)
respond_with(@object) do |format|
format.html { redirect_to location_after_destroy }
format.js { render partial: "spree/admin/shared/destroy" }
end
else
invoke_callbacks(:destroy, :fails)
respond_with(@object) do |format|
format.html { redirect_to location_after_destroy }
end
end
end
private
def collection