Skip to main content

Subscribe to GoRails to get access to this episode and all other pro episodes, and new awesome content every month.

Subscribe Now
Only $19/month

Unlimited access. Cancel anytime.

9 Handle 404s Better Using Rescue_from

Episode 226 · January 29, 2018

Rather than serving your user's a 404 dead end, we can use the ActiveSupport rescue_from method to give users search results instead and how to reuse this with ActiveSupport Concerns

ActiveSupport Concerns


Subscribe or login to view the transcript for this episode.


Arjun Rajkumar (200 XP) on

Very useful feature this is. Thanks for sharing. Also discovered 'any?' in this episode - I;ve always been using present? to check - but Googled this and it says .any? is faster. So learnt about that too :) Thanks!

Chris Oliver (159,850 XP) on

You can also use .none? to check the opposite as well. 👍

Login or create an account to join the conversation.