Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add arbitrary params to generated links #28

Closed
cseelus opened this issue May 30, 2018 · 15 comments
Closed

Add arbitrary params to generated links #28

cseelus opened this issue May 30, 2018 · 15 comments

Comments

@cseelus
Copy link
Contributor

cseelus commented May 30, 2018

The ability to add arbitrary params similar to will_paginates :params option or Kaminaris option with the same name would be helpful for a number of use cases:

@ddnexus
Copy link
Owner

ddnexus commented May 30, 2018

And what about anchors?
Would something like this work?

pagy(collection, params: {a: 'a'}, anchor: '#your_anchor')

@cseelus
Copy link
Contributor Author

cseelus commented May 30, 2018

Yep, I think that would do nicely

@ddnexus
Copy link
Owner

ddnexus commented May 30, 2018

Consider it done :)

@cseelus
Copy link
Contributor Author

cseelus commented May 30, 2018

Awesome!

@ddnexus ddnexus added implemented and removed WIP labels May 30, 2018
@ddnexus
Copy link
Owner

ddnexus commented May 30, 2018

Done. Pushed v0.8.1 to rubygem including this feature.

@ddnexus ddnexus closed this as completed May 30, 2018
@cseelus
Copy link
Contributor Author

cseelus commented May 30, 2018

That was fast :-)

Thanks for also pushing it to Rubygems, works like a charm

anchors

@ddnexus
Copy link
Owner

ddnexus commented May 31, 2018

@cseelus Glad you enjoyed the fast execution.... but now you owe pagy a step-by-step tutorial about how to get that awesome pagination working! ;)

@gamafranco
Copy link
Contributor

I think you'll be able to get a way with the tags in German, as long as the tutorial looks nice :)

@cseelus
Copy link
Contributor Author

cseelus commented May 31, 2018

Haha, did really nothing special one could write much about.

Its just the pagy_nav_bootstrap_compact helper with a few lines of CSS to coerce it into @extend ing Bootstraps btn-outline-dark style (instead of btn-default) and to replace the prev/next buttons text with arrows.

Maybe the README could be improved a little bit, as this friendly gentleman pointed out?

Btw. I opened issues with api-pagination and Pager API to ask about the possibility of supporting Pagy (they only support will_paginate and Kaminiari for now).
Thats the last thing that keeps me from using Pagy in production.

@ddnexus
Copy link
Owner

ddnexus commented May 31, 2018

Its just the pagy_nav_bootstrap_compact helper with a few lines of CSS to coerce it into @extend ing Bootstraps btn-outline-dark style (instead of btn-default) and to replace the prev/next buttons text with arrows.

Indeed, that is simple, but a step by step would be very nice.
However I was especially referring to the usage of the :params and :anchor in your little demo, switching from one tab to the other and keeping the state.

@cseelus
Copy link
Contributor Author

cseelus commented May 31, 2018

Guess I'll have to revive my blog then, after looking into helping with an adapter for Pager API ;-)

@gamafranco
Copy link
Contributor

@cseelus, let me know if you want to make a guest post to http://blog.imaginarycloud.com/.

I've covered Pagy in the past and we can make a push during lunch help raise awareness.

@gamafranco
Copy link
Contributor

Btw, this is how we got featured on Ruby Weekly :)

@cseelus
Copy link
Contributor Author

cseelus commented Jun 1, 2018

@gamafranco Shure. Just tell me what (deliverables) you need and I'll see what I can do ;-)

@gamafranco
Copy link
Contributor

Thanks. Sent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants