How to paginate an array of fetched results

steps for doing pagination is specified here
http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/