Doing will_paginate pages calculation around a record
- by Anderson De Andrade
I'm displaying a list of events. I wanted displayed the page with the events for today by default. That was easy accomplished by:
page = number_of_records_before_RECORD / number_of_pages + 1
Now I want to display the first item of today's events as the first item in that page.
Maybe there is a way to generate page numbers around a record with negative values to get back.