Type casting page to Integer with default page in Ruby and Rails
code summary ruby rails page pagination casting type casting
This is a code summary about type casting page from params in Ruby on Rails:
Here is a solution proposed by @jaredwhite@indieweb.social:
And in case you want to render an error to the end-user here is how it might work:
You can find the source code for all these images here on Github