Browse files

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.
  • Loading branch information...
1 parent 71f793e commit e9f872e04b028a2e79179338ae659173d8c7b45d @bryanlarsen committed Mar 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/will_paginate/view_helpers/action_view.rb
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]))

0 comments on commit e9f872e

Please sign in to comment.