Pagination is super helpful on dynamic sites. This article will walk through how to create a custom renderer for will_paginate rails gem.
Our goal is to look like this Tachyons Pagination Component
Go through the installation instructions.
If you already have done that, skip ahead!
Get your page running with defaults:
in your controller:
in your view:
This setup should give you some basic links that are working
go ahead and commit right now :)
3. Create your Custom Renderer!
Inside your controller create a custom renderer object:
And inside your view, use the new renderer:
At this point you should refresh the page and see a big pink pagination bar setup!
4. Customize the Renderer
If you’re inclined to figure this problem out yourself, go ahead and dig through the LinkRenderer class. Its filled with all the important bits about this blog post.
Refresh the page!
Hopefully this will get you moving in the direction you’re looking for.
If these methods stop working, go ahead and