On this platform I am working with there is a case of automatic requests that are not something we can do much about. But they send requests as
and this causes an error on the side of the platform. This gets logged, an email is send it is monitored as an error, but it is not an error for the platform and the platform should just show page=1
The page is not a number. Where do you check that the page is a number and convert it to 1?
In different cases and platforms I have:
Made the check in a concern that is then included in all controllers
Passed the @articles.paginate(page: params[:page]) to the model and the model is doing the check and then I extract this into a concern for all models.
I once had to make this check in rack even before the controller gets hit so that every “page” is automatically converted to a number if it is not a number.
My question is - where do you do it? Why you’ve decided to do it there?