Sha256: 5d2dd84633ca17eb5ddc79f654e31e04227f0686e0d557774eae65d8bb13c700

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

class Sb::PostsController < SbController
  
  protect_from_forgery
  before_filter :find_post, :only => [:show]
  
  def index
    @posts = Post.published.recent.with_dates(params[:year], params[:month], params[:day]).paginate(:all, :page=>params[:page], :per_page=>5)
  end
  
  def show
    @post.view(request.remote_ip, nil) if @post
  end
  
  def tag
  	@tag = params[:id].gsub(/~dot~/, ".")
  	@posts = Post.tagged_with(@tag).published.recent.paginate(:all, :page=>params[:page], :per_page=>5)
    render :index
  end
  
  
  private
    
    def find_post
      @post = Post.find_by_slug(params[:id])
    end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
santey_blog-0.2.1 app/controllers/sb/posts_controller.rb
santey_blog-0.2.0 app/controllers/sb/posts_controller.rb