Short Ruby Newsletter

Share this post

Type casting page to Integer with default page in Ruby and Rails

newsletter.shortruby.com
Code Summaries

Type casting page to Integer with default page in Ruby and Rails

code summary ruby rails page pagination casting type casting

Lucian Ghinda
Nov 4, 2022
Share

This is a code summary about type casting page from params in Ruby on Rails:

Here is a solution proposed by @jaredwhite@indieweb.social:

Source: https://ruby.social/web/@jaredwhite@indieweb.social/109282609587841078

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

Share
Previous
Comments
Top
New
Community

No posts

Ready for more?

© 2023 Lucian Ghinda
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing