I''am not able to catch ActionController::NoMethodError so I can display a own error message site. Can someone give me a peace of code to check it? How do you catch such errors and ActiveRecord:..... error to display a own error message site? -- Jochen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m not sure I understand you correctly (you state you''re "not able" to catch Exceptions) but rescue_action/rescue_action_in_public was made exactly for this: http://api.rubyonrails.org/classes/ActionController/Rescue.html Rails 2.0 adds rescue_from to handle different exceptions with different handlers: http://api.rubyonrails.org/classes/ActionController/Rescue/ClassMethods.html Jochen Kaechelin schrieb:> I''am not able to catch ActionController::NoMethodError so I can > display a own error message site. > > Can someone give me a peace of code to check it? > > How do you catch such errors and ActiveRecord:..... error to display a > own error message site? > > > -- > Jochen--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Am 25.12.2007 um 19:28 schrieb Java:> > I''m not sure I understand you correctly (you state you''re "not able" > to catch Exceptions) but rescue_action/rescue_action_in_public was > made exactly for this: > > http://api.rubyonrails.org/classes/ActionController/Rescue.html > > Rails 2.0 adds rescue_from to handle different exceptions with > different handlers: > http://api.rubyonrails.org/classes/ActionController/Rescue/ClassMethods.htmlCan you give me please a example how to display a own error page when a ActionController:NoMethodError occurs? Thanx -- Jochen Kaechelin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---