Skip to content

Commit

Permalink
fix for sinatra: page_param must be converted to string
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Aug 3, 2018
1 parent ad8c311 commit 3abcc11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pagy/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def pagy_info(pagy)

# This works with all Rack-based frameworks (Sinatra, Padrino, Rails, ...)
def pagy_url_for(page, pagy)
p_vars = pagy.vars; params = request.GET.merge(p_vars[:page_param] => page).merge!(p_vars[:params])
p_vars = pagy.vars; params = request.GET.merge(p_vars[:page_param].to_s => page).merge!(p_vars[:params])
"#{request.path}?#{Rack::Utils.build_nested_query(pagy_get_params(params))}#{p_vars[:anchor]}"
end

Expand Down

0 comments on commit 3abcc11

Please sign in to comment.