List Info

Thread: Help with pagintate




Help with pagintate
country flaguser name
Germany
2008-01-21 13:50:35
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)
-- 
Posted via http://www.ruby-forum.com
/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talkgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )