To render your own not found page:
rescue_from ActionController::RoutingError, ActiveRecord::RecordNotFound do |exception|
raise exception unless request.format.html?
render 'shared/not_found'
end
Feb 14, 2025
To render your own not found page:
rescue_from ActionController::RoutingError, ActiveRecord::RecordNotFound do |exception|
raise exception unless request.format.html?
render 'shared/not_found'
end