fb2b4d8a8a
chore: fix api test conventions chore: rubocop -A spec/ chore: more rubocop -A fix failing test rubocop fixes removes helper methods that are in my opinion dead code more rubocop fixes rubocop -a --auto-gen-config
25 lines
656 B
Ruby
25 lines
656 B
Ruby
class ArticleCategoriesController < ApplicationController
|
|
inherit_resources # Build default REST Actions via plugin
|
|
|
|
before_action :authenticate_article_meta
|
|
|
|
def create
|
|
create!(notice: I18n.t('article_categories.create.notice')) { article_categories_path }
|
|
end
|
|
|
|
def update
|
|
update!(notice: I18n.t('article_categories.update.notice')) { article_categories_path }
|
|
end
|
|
|
|
def destroy
|
|
destroy!
|
|
rescue StandardError => e
|
|
redirect_to article_categories_path, alert: I18n.t('article_categories.destroy.error', message: e.message)
|
|
end
|
|
|
|
protected
|
|
|
|
def collection
|
|
@article_categories = ArticleCategory.order('name')
|
|
end
|
|
end
|