-
Hi there! I am trying to implement Pagy with an existing Rails app that uses Meilisearch, but I'm running into a type-related error in the pagination. The controller action includes this: @articles = Article.published.pagy_search(params[:search])
@pagy, @articles = pagy_meilisearch(@articles, limit: 20) It accurately returns search results and pages to the view for the first page. But, if I navigate to page 2 (or any other page), I get the following error:
The trace points to I'm not really sure what to do with this information. Is there a way to coerce Pagy into returning an integer rather than a string for the page? Since Pagy has extension support for Meilisearch, I'm not really sure if the issue is manifesting entirely within Pagy or within the meilisearch/meilisearch-rails gems. Any guidance anyone can offer is appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I am not experienced with Meilesearch. It is not immediately obvious (to me) from what you've posted, what the problem could be. In my experience, reproducing the errors tend to find the problem(s)? # article.rb - check if the following is here? this is a blind stab in the dark.
extend Pagy::Meilisearch
ActiveRecord_Relation.include Pagy::Meilisearch Or try to reproduce it here: https://github.com/ddnexus/pagy/blob/master/gem/apps/rails.ru If you can adapt the above to be reproducible, then all the hidden context becomes more evident and the solution more readily found. If you are unable to reproduce from the template, msg me back further. |
Beta Was this translation helpful? Give feedback.
-
It may likely be a bug introduced with the refactoring of v9, not covered by regression tests. I will take a look at it ASAP. ( |
Beta Was this translation helpful? Give feedback.
-
@siasmj Please try the dev branch and let me know if it works. |
Beta Was this translation helpful? Give feedback.
@siasmj Please try the dev branch and let me know if it works.