On 8/22/06, hemant <gethemant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> And where should i define this method?
>
> I have defined this method in application.rb.But it doesn''t seem
to catch
> all errors. Or is it that, i must run in production mode to use this
method?
>
It''s a controller instance method, so defining it in
ApplicationController
will affect all of your controllers, as you expect.
The method is only called when local_request? is true (dev mode), so switch
to production to see the error page, or set
config.action_controller.consider_all_requests_local = false
in config/environments/development.rb
jeremy
On 8/22/06, Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org>
wrote:> >
> > On 8/21/06, hemant
<gethemant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > > I was just thinking, how do i go about this.
> > > In the latest edition of AWDR, DHH talk about something like
this.Buti guess, that part of text is still not written.
> > > So any clues?
> > >
> >
> >
http://api.rubyonrails.com/classes/ActionController/Rescue.html#M000069
> >
> > def rescue_action_in_public(exception)
> > logger.error "Ooops: #{exception}"
> > redirect_to home_url
> > end
> >
> > jeremy
> >
> >
> >
>
>
> --
> nothing much to talk
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---