foodsoft/app/controllers/article_categories_controller.rb

26 lines
656 B
Ruby
Raw Permalink Normal View History

class ArticleCategoriesController < ApplicationController
2011-05-18 16:10:30 +02:00
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
2012-11-10 16:51:30 +01:00
protected
def collection
@article_categories = ArticleCategory.order('name')
end
end