Catch exceptions when deleting ordegroups.
This commit is contained in:
parent
a27c0c67fc
commit
9ad93e9c06
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue