foodsoft/app/controllers/article_categories_controller.rb

26 lines
656 B
Ruby
Raw 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
2013-04-10 14:07:59 +02:00
create!(:notice => I18n.t('article_categories.create.notice')) { article_categories_path }
end
def update
2013-04-10 14:07:59 +02:00
update!(:notice => I18n.t('article_categories.update.notice')) { article_categories_path }
end
def destroy
destroy!
rescue => error
2013-04-10 14:07:59 +02:00
redirect_to article_categories_path, alert: I18n.t('article_categories.destroy.error', message: error.message)
end
2012-11-10 16:51:30 +01:00
protected
def collection
@article_categories = ArticleCategory.order('name')
end
end