# Will\_paginate when used with ajax going on show method

**URL:** <https://www.ruby-forum.com/t/will-paginate-when-used-with-ajax-going-on-show-method/162238>\
**Category:** Rails\
**Created:** [March 7, 2009, 10:48am UTC](https://www.ruby-forum.com/t/will-paginate-when-used-with-ajax-going-on-show-method/162238 "2009-03-07T10:48:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![neetal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@neetal](https://www.ruby-forum.com/u/neetal)\
**Post date:** [March 7, 2009, 10:48am UTC](https://www.ruby-forum.com/t/will-paginate-when-used-with-ajax-going-on-show-method/162238/1 "2009-03-07T10:48:33Z")

</div>

Hi  
I have a problem while implementing pagination.  
Am using will\_paginate for it.

I have a index page where am dispalying a list of users with pagination.

Also there is a search feature, when user searches the users list ll be  
changed according to the search result.Now comes the problem.

This list of users is changed depending upon the search criteria ,with  
the help of ajax am achieving it. And the pagination links are also  
getting replaced with the ajax call. Now when am clicking on prev next  
links , it is going on show method and id as “mehtod\_name”. I have  
declared the method search\_user in my routes.rb , but still not working  
.

Please Help

Thanks in Advance  
Neetal

---

<div class="post-metadata">

**Author:** ![neetal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@neetal](https://www.ruby-forum.com/u/neetal)\
**Post date:** [March 9, 2009, 10:46am UTC](https://www.ruby-forum.com/t/will-paginate-when-used-with-ajax-going-on-show-method/162238/2 "2009-03-09T10:46:15Z")

</div>

Neetal S. wrote:

> Hi  
> I have a problem while implementing pagination.  
> Am using will\_paginate for it.
> 
> I have a index page where am dispalying a list of users with pagination.
> 
> Also there is a search feature, when user searches the users list ll be  
> changed according to the search result.Now comes the problem.
> 
> This list of users is changed depending upon the search criteria ,with  
> the help of ajax am achieving it. And the pagination links are also  
> getting replaced with the ajax call. Now when am clicking on prev next  
> links , it is going on show method and id as “mehtod\_name”. I have  
> declared the method search\_user in my routes.rb , but still not working  
> .
> 
> Please Help
> 
> Thanks in Advance  
> Neetal

===========================

Problem solved , it was a routes problem only. As i was creating the  
method through routes , but the aplphabatical order was not correct , so  
it was going to show.But now its working.
