From 88c83bb0283b54fabc7f025db28e67ba5a15a7c9 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 26 Jul 2010 15:15:42 -0700 Subject: [PATCH] MS added pagination to the author show page --- app/controllers/authors_controller.rb | 2 +- app/views/authors/show.html.haml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb index 2f53c442b..f4e6b80c7 100644 --- a/app/controllers/authors_controller.rb +++ b/app/controllers/authors_controller.rb @@ -3,7 +3,7 @@ class AuthorsController < ApplicationController def show @author= Author.where(:id => params[:id]).first - @author_ostatus_posts = @author.ostatus_posts.sort(:created_at.desc) + @author_ostatus_posts = @author.ostatus_posts.paginate :page => params[:page], :order => 'created_at DESC' end diff --git a/app/views/authors/show.html.haml b/app/views/authors/show.html.haml index 364bf6eac..902682434 100644 --- a/app/views/authors/show.html.haml +++ b/app/views/authors/show.html.haml @@ -8,5 +8,6 @@ %ul#stream - for post in @author_ostatus_posts = render type_partial(post), :post => post + = will_paginate @author_ostatus_posts - else %h3 no posts to display!