Sha256: 7a2a9b6e2c2a4dd20426e11507d2ae5d6d92b5f8ad0111236586e0c662945d59
Contents?: true
Size: 441 Bytes
Versions: 33
Compression:
Stored size: 441 Bytes
Contents
class BlogCategoriesController < ApplicationController before_filter :find_category_by_permalink, :only => :show def index @blog_categories = BlogCategory.roots_with_posts end def show if @blog_category.blank? flash[:notice] = "That category doesn't exist." redirect_to Blog.first.path end end private def find_category_by_permalink @blog_category ||= BlogCategory.by_slug(params[:id]) end end
Version data entries
33 entries across 33 versions & 1 rubygems