class Admin::ArticleCategoriesController

Edit categories for articles for homepage. Unrelated to Event Categories.

Public Instance Methods

create() click to toggle source
# File app/controllers/admin/article_categories_controller.rb, line 22
def create
  @article_category = ArticleCategory.new(params[:article_category])

  if @article_category.save
    flash[:notice] = 'ArticleCategory was successfully created.'
    redirect_to admin_article_categories_url
  else
    render :new
  end
end
destroy() click to toggle source
# File app/controllers/admin/article_categories_controller.rb, line 44
def destroy
  @article_category = ArticleCategory.find(params[:id])
  @article_category.destroy

  redirect_to admin_article_categories_url
end
edit() click to toggle source
# File app/controllers/admin/article_categories_controller.rb, line 18
def edit
  @article_category = ArticleCategory.find(params[:id])
end
index() click to toggle source
# File app/controllers/admin/article_categories_controller.rb, line 6
def index
  @article_categories = ArticleCategory.all( :order => "parent_id, position")
end
new() click to toggle source
# File app/controllers/admin/article_categories_controller.rb, line 14
def new
  @article_category = ArticleCategory.new
end
show() click to toggle source
# File app/controllers/admin/article_categories_controller.rb, line 10
def show
  @article_category = ArticleCategory.find(params[:id])
end
update() click to toggle source
# File app/controllers/admin/article_categories_controller.rb, line 33
def update
  @article_category = ArticleCategory.find(params[:id])

  if @article_category.update_attributes(params[:article_category])
    flash[:notice] = 'ArticleCategory was successfully updated.'
    format.html redirect_to(admin_article_categories_url)
  else
    render :edit
  end
end