Class: ArticleCategoriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/article_categories_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

current

Instance Method Details

#collectionObject (protected)


23
24
25
# File 'app/controllers/article_categories_controller.rb', line 23

def collection
  @article_categories = ArticleCategory.order('name')
end

#createObject


7
8
9
# File 'app/controllers/article_categories_controller.rb', line 7

def create
  create!(:notice => I18n.t('article_categories.create.notice')) { article_categories_path }
end

#destroyObject


15
16
17
18
19
# File 'app/controllers/article_categories_controller.rb', line 15

def destroy
  destroy!
rescue => error
  redirect_to article_categories_path, alert: I18n.t('article_categories.destroy.error', message: error.message)
end

#updateObject


11
12
13
# File 'app/controllers/article_categories_controller.rb', line 11

def update
  update!(:notice => I18n.t('article_categories.update.notice')) { article_categories_path }
end