Comments (6)
Nope. You can do it right now by doing:
@pagy, @records = pagy(@mycollection, page: param[:custom_param_name])
from pagy.
and BTW... pagy_get_params
is the way to massage the params. (see Customizing the params).
The proper way to change the param name (but for all instances) would be overriding pagy_get_vars
, which would work as a default for all the pagy
calls, but... just pass a variable to the pagy method and it will override the default.
from pagy.
Yes, I also thought/wrote pagy_get_params
was the way to go to modify the page links, but to paginate two collections in one action/on one page, you would need to define two helpers that both would redefine pagy_get_params
?
from pagy.
but to paginate two collections in one action/on one page, you would need to define two helpers that both would redefine pagy_get_params?
Absolutely not:
@pagy, @records = pagy(@mycollection) # uses params[:page]
@custom_pagy1, @custom_records = pagy(@mycollection1, page: param[:custom_param_name1])
@custom_pagy2, @custom_records2 = pagy(@mycollection2, page: param[:custom_param_name2])
from pagy.
<%= pagy_nav @custom_pagy1 %>
will generate links like <a href="/collection?page=2">
though, using page
as the page param instead of custom_param_name1
.
from pagy.
True! And wrong! I have to fix that!
from pagy.
Related Issues (20)
- Bug: Alias for an aggregate result is removed HOT 9
- Bug: Issue with Arel scope passed to pagy method HOT 3
- Docs: 7.0 has an undocumented breaking change for active page styling HOT 5
- Docs: Which branch should PRs be made against? HOT 3
- Docs: Update performance metrics HOT 5
- Trim doesn't call with pagy_nav_js when first page is active
- Bug: Adapt with Mongoid add extention HOT 1
- Bug: Pagy::Backend#pagy_get_vars `count_args` gets ignored HOT 3
- Docs: https://ddnexus.github.io/pagy/quick-start/#configure HOT 1
- Bug: Missing initializer in documentation HOT 1
- Bug: wrong number of arguments (given 2, expected 0) HOT 2
- Bug: wrong number of arguments (given 2, expected 0) HOT 1
- Bug: Pagy not working with Geocoder gem
- Bug: Undocumented backwards-incompatible change of empty "page" parameter introduced in 6.4.0 HOT 3
- Docs: lost section about wrap existing pagination with pagy_calendar HOT 1
- Bug: Request for Pagy Gem: Making Commands Platform Independent HOT 1
- Bug: Pagy 8.4.0 is broken with MS SQL server HOT 18
- Bug: Only Limit 1 Query HOT 3
- Documentation: `anchor_string` option in `pagy_bootstrap_nav` (example from documentation) doesn't appear to be working HOT 1
- Docs: Some improvements in the documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagy.