Hey, I was wondering. If someone travels to a url ie. 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
brianp wrote:> Hey, > I was wondering. If someone travels to a url ie. > 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, > bpBrian visit 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 -- Posted via http://www.ruby-forum.com/.
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 On Aug 19, 12:13 am, brianp <brian.o.pea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey, > I was wondering. If someone travels to a url ie. > 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