Class: BlogCategoriesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#render_404

Instance Method Details

#indexObject



4
5
6
# File 'app/controllers/blog_categories_controller.rb', line 4

def index
  @blog_categories = BlogCategory.roots_with_posts
end

#showObject



8
9
10
11
12
13
# File 'app/controllers/blog_categories_controller.rb', line 8

def show
  if @blog_category.blank?
    flash[:notice] = "That category doesn't exist."
    redirect_to Blog.first.path
  end
end