Permalink
Browse files

Pagination

  • Loading branch information...
1 parent 8e78348 commit 4a3f0724abac97804af43ebb432bd8cedd5813d7 @ferblape ferblape committed Oct 5, 2010
Showing with 5 additions and 4 deletions.
  1. +2 −1 Gemfile
  2. +3 −3 app/controllers/blog/posts_controller.rb
View
@@ -1 +1,2 @@
-gem 'filters_spam', '~> 0.3'
+gem 'filters_spam', '~> 0.3'
+gem "will_paginate", "~> 3.0.pre2"
@@ -2,14 +2,14 @@ class Blog::PostsController < BlogController
before_filter :find_all_blog_posts
before_filter :find_blog_post, :only => [:show, :comment]
-
+
def index
respond_to do |format|
format.html
format.rss
end
end
-
+
def show
@blog_comment = BlogComment.new
present(@page)
@@ -37,7 +37,7 @@ def find_blog_post
end
def find_all_blog_posts
- @blog_posts = BlogPost.live
+ @blog_posts = BlogPost.live :page => params[:page], :per_page => RefinerySetting.find_or_set(:posts_per_page, 10)
end
end

0 comments on commit 4a3f072

Please sign in to comment.