- Short Ruby Newsletter
- Posts
- Type casting page to Integer with default page in Ruby and Rails
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 @[email protected]:
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
Reply