From 934f602e43a1156d2cb7bea5e4edfefc36e9dd4f Mon Sep 17 00:00:00 2001
From: Domizio Demichelis
Date: Sat, 5 Jun 2021 19:26:52 +0700
Subject: [PATCH] added comment in doc example about the inverted order of
arguments in previous versions
---
docs/how-to.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/how-to.md b/docs/how-to.md
index 5fc704b9a..12bd075cc 100644
--- a/docs/how-to.md
+++ b/docs/how-to.md
@@ -281,7 +281,7 @@ When you need somethig more radical with the URL than just massaging the params,
The following is a Rails-specific alternative that supports fancy-routes (e.g. `get 'your_route(/:page)' ...` that produce paths like `your_route/23` instead of `your_route?page=23`):
```ruby
-def pagy_url_for(pagy, page)
+def pagy_url_for(pagy, page) # it was (page, pagy) in previous versions
params = request.query_parameters.merge(pagy.vars[:page_param] => page )
url_for(params)
end
@@ -294,7 +294,7 @@ Notice that this overridden method is quite slower than the original because it
You may need to POST a very complex search form that would generate an URL potentially too long to be handled by a browser, and your page links may need to use POST and not GET. In that case you can try this simple solution:
```ruby
-def pagy_url_for(_, page)
+def pagy_url_for(_, page) # it was (page, pagy) in previous versions
page
end
```