# Paginating

**URL:** <https://www.ruby-forum.com/t/paginating/144342>\
**Category:** Rails\
**Created:** [July 28, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/paginating/144342 "2008-07-28T20:30:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdrietz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jdrietz](https://www.ruby-forum.com/u/jdrietz)\
**Post date:** [July 28, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/paginating/144342/1 "2008-07-28T20:30:20Z")

</div>

Hey, anybody know how to set will\_paginate to find only the :first  
match?

def self.search(search, page)  
paginate :per\_page =\> 15, :page =\> page,  
:conditions =\> [‘title like ?’, “%#{search}%”], :order  
=\> ‘thread\_id DESC, created\_at DESC’  
end

Thanks

---

<div class="post-metadata">

**Author:** ![jdrietz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jdrietz](https://www.ruby-forum.com/u/jdrietz)\
**Post date:** [July 28, 2008, 9:28pm UTC](https://www.ruby-forum.com/t/paginating/144342/2 "2008-07-28T21:28:31Z")

</div>

if you’re trying to paginate one at a time, set the :per\_page to 1.

On Mon, Jul 28, 2008 at 1:30 PM, Justin Roger \<

---

<div class="post-metadata">

**Author:** ![jdrietz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jdrietz](https://www.ruby-forum.com/u/jdrietz)\
**Post date:** [July 28, 2008, 9:54pm UTC](https://www.ruby-forum.com/t/paginating/144342/3 "2008-07-28T21:54:46Z")

</div>

Brian H. wrote:

> if you’re trying to paginate one at a time, set the :per\_page to 1.
> 
> On Mon, Jul 28, 2008 at 1:30 PM, Justin Roger \<

No, I have various rows with similar ID #s and I want to display only  
the :first one (most recently updated) in the group

e.g.  
id | content |updated  
1 | a | fri  
1 | b | thur  
2 | c | wed  
2 | d | mon

I want only 1|a|fri and 2|c|wed
