# Will\_paginate urls and AJAX calls

**URL:** <https://www.ruby-forum.com/t/will-paginate-urls-and-ajax-calls/166756>\
**Category:** Rails\
**Created:** [April 29, 2009, 8:56am UTC](https://www.ruby-forum.com/t/will-paginate-urls-and-ajax-calls/166756 "2009-04-29T08:56:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/dc4da7/32.png) [@trev](https://www.ruby-forum.com/u/trev)\
**Post date:** [April 29, 2009, 8:56am UTC](https://www.ruby-forum.com/t/will-paginate-urls-and-ajax-calls/166756/1 "2009-04-29T08:56:23Z")

</div>

I am using will\_paginate to paginate my site. I also have a  
link\_to\_remote in my view that will toggle view modes (from list to  
icon view). My will\_paginate code works fine until I click on my  
link\_to\_remote. At that point my will\_paginate code (which is in the  
partial that is updated in the link\_to\_remote) is broken.

i.e. the link changes from /documents?page=1 to /documents/toggle\_view?  
page=1

Here are some code snippets:  
[http://pastie.org/462034](http://pastie.org/462034)

Any help on this would be great.

Thanks,  
trv

---

<div class="post-metadata">

**Author:** ![trev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/dc4da7/32.png) [@trev](https://www.ruby-forum.com/u/trev)\
**Post date:** [April 29, 2009, 12:30pm UTC](https://www.ruby-forum.com/t/will-paginate-urls-and-ajax-calls/166756/2 "2009-04-29T12:30:09Z")

</div>

Hi  
Can you try like

[http://www.ruby-forum.com/topic/134632#726021](http://www.ruby-forum.com/topic/134632#726021)

Sijo
