Rails 2.0 has a much nicer way of dealing with this, since you can do
class PostsController < ApplicationController rescue_from FooError, :with => :foo_handler
protected def foo_handler end end
I am trying to use this to display the 404 HTML file in case of routing error :
rescue_from ActionController::RoutingError, :with => :show_404
But it never gets called, and I still get a :
No route matches "/foo" with {:method=>:get} vendor/rails/actionpack/lib/action_controller/routing.rb:1411:in `recognize_path' (...)
Any idea ? I am in production environment.