CSN
2006-Feb-07 03:49 UTC
[Rails] AWDWR: NameError (uninitialized constant UnknownAction) in rescue_action_in_public
I copied (and modified) this code from AWDWR: def rescue_action_in_public(exception) case exception when ActiveRecord::RecordNotFound, ActionController::UnknownAction render :template=>''/error'', :layout=>''application'', :status=>''404 Not Found'' else render :template=>''/error'', :layout=>''application'', :status=>''500 Error'' end Notifier.deliver_exception(self, request, exception) end It works, except when an ''unknown action'' occurs, then it displays this in the log: NameError (uninitialized constant UnknownAction): /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.4/lib/active_support/dependencies.rb:200:in `const_missing'' .//app/controllers/application.rb:63:in `rescue_action_in_public'' Any idea what the problem is? Thanks csn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Mark Reginald James
2006-Feb-09 10:13 UTC
[Rails] Re: AWDWR: NameError (uninitialized constant UnknownAction) in rescue_action_in_public
CSN wrote:> I copied (and modified) this code from AWDWR: > > def rescue_action_in_public(exception) > case exception > when ActiveRecord::RecordNotFound, > ActionController::UnknownAction > render :template=>''/error'', :layout=>''application'', > :status=>''404 Not Found'' > else > render :template=>''/error'', :layout=>''application'', > :status=>''500 Error'' > end > > Notifier.deliver_exception(self, request, exception) > end > > It works, except when an ''unknown action'' occurs, then > it displays this in the log: > > NameError (uninitialized constant UnknownAction): > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.4/lib/active_support/dependencies.rb:200:in > `const_missing'' > .//app/controllers/application.rb:63:in > `rescue_action_in_public''Try ::ActionController::UnknownAction -- We develop, watch us RoR, in numbers too big to ignore.