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.

Allow filtering of what params get serialized

#148

When developing facebook apps, facebook passes lots of fb_* parameters in each request which shouldn't be included in the previous/next/page number links. A quick hack I did to filter these out:

Index: vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb
===================================================================
--- vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb      (revision 3718)
+++ vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb      (revision 3719)
@@ -115,7 +115,7 @@
         @template.content_tag :span, text, :class => span_class
       else
         # page links should preserve GET/POST parameters
-        @template.link_to text, @template.params.merge(param => page != 1 ? page : nil)
+        @template.link_to text, @template.params.reject { |k,v| k[0..2] == 'fb_' }.merge(param => page != 1 ? page : nil)
       end
     end

It'd be nice if we could pass in an ":ignore_params => /^fb_/" type option somewhere.

Reported by wkonkel (at gmail) · November 7th, 2007 @ 03:14 AM

State: invalid
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • Assigned user changed from Chris Wanstrath to Mislav
    • State changed from new to open

    November 10th, 2007 @ 02:58 AM

  2. Mislav
    Mislav
    • State changed from open to invalid

    Follow #119, I'll post updates about this issue there... You'll be able to control params in page links

    December 19th, 2007 @ 04:25 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.