# Will\_paginate destroys link\_to\_remote?!

**URL:** <https://www.ruby-forum.com/t/will-paginate-destroys-link-to-remote/191486>\
**Category:** Rails\
**Created:** [July 13, 2010, 12:34pm UTC](https://www.ruby-forum.com/t/will-paginate-destroys-link-to-remote/191486 "2010-07-13T12:34:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [July 13, 2010, 12:34pm UTC](https://www.ruby-forum.com/t/will-paginate-destroys-link-to-remote/191486/1 "2010-07-13T12:34:49Z")

</div>

Hello,

I’ve got a list in a view and each of element of it has a link\_to\_remote  
and everything worked like a charm. Now I added AJAX pagination and the  
link\_to\_remote doesn’t work anymore.

This is the partial of the list:  
\<% for character in characters %\>  
\<%= character.name %\>  
\<%= link\_to\_remote t(’.add’), :url =\>  
add\_character\_activity\_path(@activity), :method =\> :get %\>  
\<% end %\>  
\<%= will\_paginate characters, :param\_name =\> param\_name %\>

The add\_character function in the controller is being called and doesn’t  
throw any error but the only thing that is not working anymore is the  
AJAX stuff in the add\_character.rjs which is being called after the  
function in the controller (of course):  
page.replace\_html “current\_number”, @current\_number

The current\_number is not being updated anymore. All I did was that I  
moved the \<% for …%\> from the view to a partial and added  
will\_paginate.

Does anyone know why this is not working anymore?

Thanks

---

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [July 13, 2010, 12:43pm UTC](https://www.ruby-forum.com/t/will-paginate-destroys-link-to-remote/191486/2 "2010-07-13T12:43:01Z")

</div>

How to post in this group?

[http://chozzhan.blogspot.com](http://chozzhan.blogspot.com)
