Avoid deleting categories which still have articles.
This commit is contained in:
parent
620ec946f1
commit
bae09624b7
3 changed files with 20 additions and 0 deletions
|
|
@ -12,6 +12,12 @@ class ArticleCategoriesController < ApplicationController
|
|||
update!(:notice => "Die Kategorie wurde aktualisiert") { article_categories_path }
|
||||
end
|
||||
|
||||
def destroy
|
||||
destroy!
|
||||
rescue => error
|
||||
redirect_to article_categories_path, alert: t('controller.article_categories.destroy.error', message: error.message)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def collection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue