2009-01-16 16:19:26 +01:00
|
|
|
class ArticleCategoriesController < ApplicationController
|
2011-05-18 16:10:30 +02:00
|
|
|
inherit_resources # Build default REST Actions via plugin
|
2009-01-16 16:19:26 +01:00
|
|
|
|
2019-10-28 21:11:35 +01:00
|
|
|
before_action :authenticate_article_meta
|
2009-01-16 16:19:26 +01:00
|
|
|
|
|
|
|
def create
|
2023-05-12 13:01:12 +02:00
|
|
|
create!(notice: I18n.t('article_categories.create.notice')) { article_categories_path }
|
2009-01-16 16:19:26 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
2023-05-12 13:01:12 +02:00
|
|
|
update!(notice: I18n.t('article_categories.update.notice')) { article_categories_path }
|
2009-01-16 16:19:26 +01:00
|
|
|
end
|
|
|
|
|
2012-12-11 10:53:01 +01:00
|
|
|
def destroy
|
|
|
|
destroy!
|
2023-05-12 13:01:12 +02:00
|
|
|
rescue StandardError => e
|
|
|
|
redirect_to article_categories_path, alert: I18n.t('article_categories.destroy.error', message: e.message)
|
2012-12-11 10:53:01 +01:00
|
|
|
end
|
|
|
|
|
2012-11-10 16:51:30 +01:00
|
|
|
protected
|
|
|
|
|
|
|
|
def collection
|
|
|
|
@article_categories = ArticleCategory.order('name')
|
|
|
|
end
|
2009-01-16 16:19:26 +01:00
|
|
|
end
|