Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Rendering pagination via Ajax causes the links to point to ajax method

#266

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.

Reported by Michael Larkin · March 31st, 2009 @ 04:07 PM

State: invalid
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Michael Larkin
    Michael Larkin

    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 %>

    
    

    March 31st, 2009 @ 08:49 PM

  2. Mislav
    Mislav

    Hey Mike,

    How about:

    
    <%= will_paginate @collection, :params => { :action => 'index' } %>
    

    Didn't you read the API docs?

    March 31st, 2009 @ 11:45 PM

  3. Michael Larkin
    Michael Larkin

    Mislav,

    Apparently not closely enough, sorry!

    Thanks, I'll give that a whirl!

    March 31st, 2009 @ 11:49 PM

  4. Michael Larkin
    Michael Larkin

    Yep, that was exactly what I needed, thanks! Consider this one a non-bug.

    April 1st, 2009 @ 04:12 AM

  5. Mislav
    Mislav
    • State changed from new to invalid

    April 1st, 2009 @ 12:02 PM

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.