My rescue_action_in_public method catches ActiveRecord::RecordNotFound
errors perfectly find, but when I try to catch
ActionController::UnknownAction, I get the following error:
uninitialized constant UnknownAction
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dep
endencies.rb:123:in const_missing' #{RAILS_ROOT}/app/controllers/application.rb:233:in
rescue_action_in_public’
/usr/local/bin/mongrel_rails:18
This error occured while loading the following files:
action_web_service/dispatcher/action_controller/unknown_action.rb
Here’s my rescue method in application.rb:
def rescue_action_in_public(e)
case e
when ActiveRecord::RecordNotFound,
ActionController::UnknownAction then
render :file => “#{RAILS_ROOT}/public/404.html”,
:status => 404
else
render :file => “#{RAILS_ROOT}/public/500.html”,
:status => 500
end
end
Any ideas why this is happening?