A partial solution to getting will_paginate to show all the results on the one page.
I chose to stick the link that will cause all the results to be displayed inside the pagination menu using jQuery.
This should go in your view
// Create the link var show_all_link = ' @matches.size, :page => 1), :class => "show-all" %>'; $('a.next_page, span.next_page').after(show_all_link); // Place the link after the next page link
And this in your controller
per_page = params[:show] || 50 # How many items to display @paginated_matches = @matches.paginate(:page => params[:page], :per_page => per_page)
I say it’s only a partial solution because will_paginate will not display the pagination menu when displaying all results like this. If I come up with a workaround or a better solution I’ll post it here, but if any of you guys have any success stick it in the comments and I’ll edit the post appropriately.