General rescue throughout controller when id not found - RoR
问题 I have stumbled upon a situation where my application looks for an id that does not exist in the database. An exception is thrown. Of course, this is a pretty standard situation for any web developer. Thanks to this answer I know that using rescue deals with the situation pretty neatly, like so: def show @customer = Customer.find(params[:id]) rescue ActiveRecord::RecordNotFound #customer with that id cannot be found redirect_to action: :index #redirect to index page takes place instead of