Sha256: 4fef675354537d739dea8c77bd5356aa842881bf79234efc6383a42a70a6a18f

Contents?: true

Size: 498 Bytes

Versions: 4

Compression:

Stored size: 498 Bytes

Contents

class BlogsController < ApplicationController
  before_filter :scope_blog

  def archive
    @posts_by_month = @blog.posts_by_month
  end

  def feed
    @posts = @blog.posts.published
  end

  def search
    @posts = params[:keyword] ? @blog.search(params[:keyword]) : []
  end

  def show
    @posts = @blog.posts.page(params[:page]).published.per @blog.posts_per_page
    render_404 if @posts.blank?
  end

  private

  def scope_blog
    @blog = Blog.by_slug(params[:blog_slug]).first
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blog_logic-1.4.15 app/controllers/blogs_controller.rb
blog_logic-1.4.14 app/controllers/blogs_controller.rb
blog_logic-1.4.13 app/controllers/blogs_controller.rb
blog_logic-1.4.12 app/controllers/blogs_controller.rb