# Ajax Pagination Problem

**URL:** <https://www.ruby-forum.com/t/ajax-pagination-problem/146457>\
**Category:** Rails\
**Created:** [August 21, 2008, 11:17am UTC](https://www.ruby-forum.com/t/ajax-pagination-problem/146457 "2008-08-21T11:17:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmvipin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/c0e974/32.png) [@vmvipin](https://www.ruby-forum.com/u/vmvipin)\
**Post date:** [August 21, 2008, 11:17am UTC](https://www.ruby-forum.com/t/ajax-pagination-problem/146457/1 "2008-08-21T11:17:10Z")

</div>

Hi All,

Am Using will\_paginate with lowpro  
([http://railsontherun.com/2007/9/27/ajax-pagination-in-less-than-5-minutes](http://railsontherun.com/2007/9/27/ajax-pagination-in-less-than-5-minutes)).  
It works fine. My problem is, am using ajax methods for add, edit,  
update and delete. When i click “Â« Previous 1 2 Next Â»” it calls the  
last method call.

For ie i have 13 records in my table (10 records in 1st page and 3 in  
2nd page). If i add 1 new record (using ajax), it added nicely (Total 14  
records). but if i click paginator link (2 or Next), it calls the same  
add method and add a duplicate of the last record (Total 15 records).

The delete operation is also working fine (delete record id = 7), then  
if i click paginator link it shows an error in firebug that there is no  
such entry with id 7. (it calls the previous delete method again)

Is there any way to solve this?

Thanks in advance,

Vipin
