My rescue_action_in_public works fine catching ActiveRecord::RecordNotFound errors, but when I try to catch ActionController::UnknownAction I get the following error display: ----------------------------------------------------------------- uninitialized constant UnknownAction /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.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 ----------------------------------------------------------------- and my rescue method: def rescue_action_in_public(e) case e when ActiveRecord::RecordNotFound, ActionController::UnknownAction render :file => "#{RAILS_ROOT}/public/404.html", :status => 404 else render :file => "#{RAILS_ROOT}/public/500.html", :status => 500 end end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
nobody''s rescue''d an UnknownAction error to generate a 404? On Nov 28, 11:47 pm, "Chad Arimura" <carim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chad wrote:> nobody''s rescue''d an UnknownAction error to generate a 404?http://groups.google.com/group/rubyonrails-talk/search?q=UnknownAction -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Mark, but I read all those before and am still getting the same uninitialized constant error. If you know of a post that I missed, please by all means let me know. Cheers, Chad -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Mark Reginald James Sent: Wednesday, November 29, 2006 6:54 PM To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] Re: rescue''ing UnknownAction Chad wrote:> nobody''s rescue''d an UnknownAction error to generate a 404?http://groups.google.com/group/rubyonrails-talk/search?q=UnknownAction -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Fair enough. Found it this time. It just took a day to soak it up then I found the :: prefix. I didn''t know a :: prefix was valid ruby code. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---