foodsoft/app/controllers/article_categories_controller.rb
Philipp Rothmann fb2b4d8a8a chore: rubocop
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
2023-06-09 17:35:05 +02:00

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