Rendering pagination via Ajax causes the links to point to ajax method
Reported by Michael Larkin | 2009-03-31 16:07:41 UTC
I use will_paginate in my application to page using non-ajaxy requests. However, the delete method in my grid is ajaxy, and replaces the entire grid (including pagination links) when an item is deleted.
However, the pagination links no longer point to the index method, but instead to the delete, which is incorrect.
For example:
/promotions?page=2 is what it should be /promotions/:id/delete?page=2 is what it ends up being, which is obviously impossible because the object was just deleted so the route is not valid.
Comments and changes to this ticket
-

Michael Larkin 2009-03-31 20:49:03 UTC
I guess what I'm driving at is I'd like an option to set the pagination URL:
@@@ Ruby <%= will_paginate :orders, :url => page_orders_path %>
-

Mislav 2009-03-31 23:45:23 UTC
Hey Mike,
How about:
<%= will_paginate @collection, :params => { :action => 'index' } %>Didn't you read the API docs?
-

Michael Larkin 2009-03-31 23:49:25 UTC
Mislav,
Apparently not closely enough, sorry!
Thanks, I'll give that a whirl!
-

Michael Larkin 2009-04-01 04:12:04 UTC
Yep, that was exactly what I needed, thanks! Consider this one a non-bug.
-

Mislav 2009-04-01 12:02:35 UTC
- State changed from new to invalid
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Everyone's favorite Ruby library for pagination of practically anything!