Hi,

I'm using pagination to create paged results and so far I've got Previous and Next page links going like so:

Code:
recipe_controller.rb
 
 def list
 		@category = @params['category']
 		@recipe_pages, @recipes = paginate :recipes, :per_page => 2
 	end
Code:
list.rhtml
 
 <%= link_to 'Previous page', { :page => @recipe_pages.current.previous } if @recipe_pages.current.previous %>
 <%= link_to 'Next page', { :page => @recipe_pages.current.next } if @recipe_pages.current.next %>
How could I make it so it would return the number of pages with links to each page, like how a forum would do it?

Thanks