# Method not found \> Error page

**URL:** <https://www.ruby-forum.com/t/method-not-found-error-page/173999>\
**Category:** Rails\
**Created:** [August 19, 2009, 6:14am UTC](https://www.ruby-forum.com/t/method-not-found-error-page/173999 "2009-08-19T06:14:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@brianp](https://www.ruby-forum.com/u/brianp)\
**Post date:** [August 19, 2009, 6:14am UTC](https://www.ruby-forum.com/t/method-not-found-error-page/173999/1 "2009-08-19T06:14:44Z")

</div>

Hey,  
I was wondering. If someone travels to a url ie.  
[app.com/controller/method](http://app.com/controller/method)

and method does not exist. How do i present them with a page not found  
error instead of getting Rails method not found errors?

thanks,  
bp

---

<div class="post-metadata">

**Author:** ![brianp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@brianp](https://www.ruby-forum.com/u/brianp)\
**Post date:** [August 19, 2009, 6:54am UTC](https://www.ruby-forum.com/t/method-not-found-error-page/173999/2 "2009-08-19T06:54:24Z")

</div>

brianp wrote:

> Hey,  
> I was wondering. If someone travels to a url ie.  
> [app.com/controller/method](http://app.com/controller/method)
> 
> and method does not exist. How do i present them with a page not found  
> error instead of getting Rails method not found errors?
> 
> thanks,  
> bp

Brian

visit [http://www.classifiedscript.in](http://www.classifiedscript.in) and download railslist. It  
drastically increases your learning speed. for your specific question,  
look into application controller. For a better understanding go to  
Ryan’s railscasts. They are superb.

in your application controller you can use

def rescue\_with\_handler(exception)  
render :file =\> “#{RAILS\_ROOT}/public/404.html”  
end

---

<div class="post-metadata">

**Author:** ![brianp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@brianp](https://www.ruby-forum.com/u/brianp)\
**Post date:** [August 19, 2009, 7:36pm UTC](https://www.ruby-forum.com/t/method-not-found-error-page/173999/3 "2009-08-19T19:36:07Z")

</div>

Read about routes. I’m not an expert but I remember reading about  
being able to set a default ‘catch all’ to redirect wherever you want.

Pepe
