Rendering pagination via Ajax causes the links to point to ajax method
Reported by Michael Larkin | March 31st, 2009 @ 04:07 PM
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 March 31st, 2009 @ 08:49 PM
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 March 31st, 2009 @ 11:45 PM
Hey Mike,
How about:
<%= will_paginate @collection, :params => { :action => 'index' } %>
Didn't you read the API docs?
-
Michael Larkin March 31st, 2009 @ 11:49 PM
Mislav,
Apparently not closely enough, sorry!
Thanks, I'll give that a whirl!
-
Michael Larkin April 1st, 2009 @ 04:12 AM
Yep, that was exactly what I needed, thanks! Consider this one a non-bug.
-
Mislav April 1st, 2009 @ 12:02 PM
- 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!