You can overwrite the ''method_missing'' method in
ApplicationController:
class ApplicationController < ActionController::Base
def method_missing (name, *args)
render_text "My 404: action ''#{name}'' not
found."
end
end
2005/10/25, Jaap Schreurs
<jhschreurs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Although a bit dirty: redirect to an url with a non-existent
> controller? Doesn''t help you when you want to do something with
404
> though.
>
> Jaap
>
> On 10/19/05, Kevin Skoglund
<kevin-WGmuFPN42W8gMxX8nMqP6gC/G2K4zDHf@public.gmane.org> wrote:
> > In my rails app, I have the standard mapping:
> > myurl.com/:controller/:action/:id
> >
> > If I give it a bad ID, I get a 404 page not found error. If I give
> > it a bad controller, I get a 404 page not found error. But if I
> > request a bad action, I get an error message that says only
> > "Application error (Rails)".
> >
> > How can I edit this behavior? I''d like it to generate 404
errors for
> > any action that it can''t sort out too.
> >
> > Kevin Skoglund
> > kevin-WGmuFPN42W8gMxX8nMqP6gC/G2K4zDHf@public.gmane.org
> > _______________________________________________
> > Rails mailing list
> > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
> >
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>