Randy Girard

Will paginate – how to pass custom parameters

I came across and issue today that involved my pagination not working correctly. What was happening was a user would do a search with various criteria and the result would show with pagination links. Once they clicked on a new page, it would return them to a list of results, but that wasn’t using any criteria. The solution was fairly simple, but not obviously documented. (Unless you look in the source files)

= will_paginate @object, :params => { :custom_param => @custom_param_value }

Here are some additional custom params you can use:

Display options

HTML options

Advanced options