app/controllers/blog_controller.rb in spud_blog-0.8.15 vs app/controllers/blog_controller.rb in spud_blog-0.8.16
- old
+ new
@@ -20,9 +20,14 @@
end
cache_sweeper :spud_post_comment_sweeper, :only => [:create_comment]
def index
+ page = 1
+ if params[:page].blank? == false && params[:page].to_i > 1
+ page = params[:page].to_i
+ end
+
@posts = SpudPost.public_blog_posts(params[:page], Spud::Blog.config.posts_per_page)
if Spud::Core.config.multisite_mode_enabled
@posts = @posts.for_spud_site(current_site_id)
end
respond_with @posts