Catch exceptions when deleting ordegroups.

This commit is contained in:
benni 2011-06-10 13:33:10 +02:00
parent a27c0c67fc
commit 9ad93e9c06
1 changed files with 8 additions and 0 deletions

View File

@ -16,4 +16,12 @@ class Admin::OrdergroupsController < Admin::BaseController
format.js { render :layout => false } # index.js.erb
end
end
def destroy
@ordergroup = Ordergroup.find(params[:id])
@ordergroup.destroy
redirect_to admin_ordergroups_url, :notice => "Bestellgruppe wurde gelöscht"
rescue => error
redirect_to admin_ordergroups_url, :alert => "Bestellgruppe konnte nicht gelöscht werden: #{error}"
end
end