In the case where I have the id of a paginated item, how can I find its page number?
I'm using rails 3 and kaminari.
Unfortunately passing the page number as a parameter is not an option. The paginated items are images of an image gallery maintained by user generated content evolving over time. This means an image may appear on page one on week one but page 2 a subsequent week.
Another option would have been maintaining a numeric order of images (acts_as_list), again this is not possible in my case as photos may appear in multiple galleries of varying scopes.
edit:
Have added a bounty to this as I see this same question asked years ago in various places with no solution. I'm happy to accept an sql query if no active record solution comes up.