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

Allow the user to choose paginator gem #440

Open
andyduong1920 opened this issue Jul 11, 2023 · 5 comments
Open

Allow the user to choose paginator gem #440

andyduong1920 opened this issue Jul 11, 2023 · 5 comments

Comments

@andyduong1920
Copy link
Member

Why

As in some projects prefer to use kaminari over pagy, so I think our template should allow the user to choose the pagination tool when generating the new project.

Who Benefits?

Developers

@andyduong1920
Copy link
Member Author

Hi @malparty, as you changed from Pagy to Kaminari in one of your projects, and you're using Kaminari now, do you think this feature is needed?

@andyduong1920
Copy link
Member Author

Please hold on this issue as we are having some issues on the View helper with Kaminari on Ruby 3.2 and Ruby 3.1 :D and I just realized the last release from Kaminari was in 2021 🧓

@andyduong1920
Copy link
Member Author

The issue we faced in our project is different, it's because we used the older Kaminari version :D upgraded to 1.2.2 and everything works as expected, so no issue with Kaminari and Ruby 3.x

@malparty
Copy link
Member

@andyduong1920 to be honest, I took too much time comparing both to end up to the conclusions:

  • the speed benefits of Pagy are negligible and only available if you do NOT request for the total item counts
  • Kaminari adds the page artifacts into the model, which feels more "the Rails way"

In other words, working with any of these 2 options is super fine AND changing the gem after generating the app is super easy 🤔

So instead of a complex "prompt the user for which pagination gem to use", I would recommend just providing a single GEM and ensuring it remains easy to change if needed 🤔 (that's just my opinion of course).

@malparty
Copy link
Member

As a small update, Pagy looks indeed more active so I would also recommend using it over Kaminari ✅

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

2 participants