Skip to content

Commit

Permalink
simplification of pagy_url_for
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed May 28, 2018
1 parent 144c997 commit 527cd8e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/pagy/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ def pagy_info(pagy)

# this works with all Rack-based frameworks (Sinatra, Padrino, Rails, ...)
def pagy_url_for(n)
url = request.path
params = request.GET.merge('page'.freeze => n.to_s)
url << '?' << Rack::Utils.build_nested_query(pagy_get_params(params))
"#{request.path}?#{Rack::Utils.build_nested_query(pagy_get_params(params))}"
end


Expand Down

0 comments on commit 527cd8e

Please sign in to comment.