# Find the position/page of an item

**URL:** <https://www.ruby-forum.com/t/find-the-position-page-of-an-item/111944>\
**Category:** Rails\
**Created:** [August 13, 2007, 7:23pm UTC](https://www.ruby-forum.com/t/find-the-position-page-of-an-item/111944 "2007-08-13T19:23:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [August 13, 2007, 7:23pm UTC](https://www.ruby-forum.com/t/find-the-position-page-of-an-item/111944/1 "2007-08-13T19:23:51Z")

</div>

I have a pagination system that works in a standard sort of way: i get  
the items (“articles” in this case) on a given page by saying

Article.find(  
:all,  
:order =\> “points DESC, added\_at DESC”,  
:limit =\> items\_per\_page,  
:offset =\> offset  
)

But now i want to do the reverse - given an article\_id, how do i get the  
page with that article? I’m sure this is some simple sql thing but i  
can’t figure it out.

thanks in advance  
max
