I dont know what I am doing wrong. I was trying to use the pagination that is built into rails, wouldnt work, tried will_paginate, still wont work. I have a drop down list where the user will choose one of the countrys in the list. I use the following to do the search... @country = params[:country] <-- option from the drop down list @searches = Searches.paginate_by_country @country, :page => params[:page], :per_page => 10 In the view everything works great and it shows links for the different pages that the results are split up into. I click on one and the page is blank. Is it a problem with passing the param from the drop down list to the next page? Thanks in advance, Chris -- 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The problem is when u using will_paginate or any other thing for pagination this will happen unless u pass the search term as params with the url... try to pass the search term using params in view and in controller try to use that and find from Db.. What actually happens behind the process is.. For the first time that Searches.paginate_by_country will fetch all the records from Db and displays only the number of records specied in page size... Next time on clicking the next or page links.. The same method doing the search will be called and the next set of records will be displayed, params[:page] is the page number parameter(this species which set, either first set or next set or the third one) like ?page=2 which is appended to the url... try to pass yr search term also with this... -- 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---