Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add :ignore_params option to the action_view LinkRenderer #229

Closed
wants to merge 1 commit into from

3 participants

@bryanlarsen

the will_paginate view helper copies query parameters from the request
onto the page links. This is virtually always the right thing to do
for standard requests, but when the links are inside an HTML fragment
generated via AJAX, those links often contain extra params that
shouldn't be mirrored into the link.

@bryanlarsen bryanlarsen add :ignore_params option to the action_view LinkRenderer
the will_paginate view helper copies query parameters from the request
onto the page links.   This is virtually always the right thing to do
for standard requests, but when the links are inside an HTML fragment
generated via AJAX, those links often contain extra params that
shouldn't be mirrored into the link.
b74cd70
@iox

@mislav, could you review this too? Thank you very much!

@mislav
Owner

I'm reluctant to add new options to will_paginate, as there is already too many of them.

This is related to #100 in a way that it's about tweaking links output. Yes, will_paginate doesn't let you do this easily right now. No, I don't think this is the solution. You may need to write your link renderer.

@mislav mislav closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2012
  1. @bryanlarsen

    add :ignore_params option to the action_view LinkRenderer

    bryanlarsen authored
    the will_paginate view helper copies query parameters from the request
    onto the page links.   This is virtually always the right thing to do
    for standard requests, but when the links are inside an HTML fragment
    generated via AJAX, those links often contain extra params that
    shouldn't be mirrored into the link.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/will_paginate/view_helpers/action_view.rb
View
2  lib/will_paginate/view_helpers/action_view.rb
@@ -117,7 +117,7 @@ def url(page)
def merge_get_params(url_params)
if @template.respond_to? :request and @template.request and @template.request.get?
- symbolized_update(url_params, @template.params)
+ symbolized_update(url_params, @template.params.except(*@options[:ignore_params]))
end
url_params
end
Something went wrong with that request. Please try again.