# Help with pagintate

**URL:** <https://www.ruby-forum.com/t/help-with-pagintate/126740>\
**Category:** Rails\
**Created:** [January 21, 2008, 8:50pm UTC](https://www.ruby-forum.com/t/help-with-pagintate/126740 "2008-01-21T20:50:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 21, 2008, 8:50pm UTC](https://www.ruby-forum.com/t/help-with-pagintate/126740/1 "2008-01-21T20:50:35Z")

</div>

I have this code in Repair\_Tickets\_controller:

```
@repair_tickets = RepairTicket.paginate :per_page => 10, :page =>

```

params[:page],  
:conditions =\> [‘ID like ?’,  
“%#{params[:search]}%”],  
:order =\> ‘id DESC’

And this code in Incidences controller:

```
@incidences = Incidence.paginate :per_page => 2, :page =>

```

params[:page],  
:conditions =\> [‘ID like ?’,  
“%#{params[:search]}%”],  
:order =\> ‘ID DESC’

When I make a seach in Repair Tickets index, it works fine, but when I  
try to do a search in Incidences index, it always redirects like if it  
was a Repair TIckets Seach (it’s always searching Repair Tickets, not  
incidences)
