I want to display the 404.html page for routes that are not defined in my application. So if a visitor tries to visit "http:://www.yoursite.com/undefined" instead of "Routing error" they will get my 404.html page. How can this be handled? Is there a way to setup something in routes.rb for all routes not defined and/or not controller/action? Thanks... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Not sure if this is the best way to go about this, so hopefully someone else will comment, but if you put: map.connect ''*anything'', :controller => "blah", :action => "unknown_request" at the end of your routes, it will map anything it doesnt recognize to the "unknown_request" action. On Sep 5, 2006, at 8:14 PM, ry an wrote:> > I want to display the 404.html page for routes that are not defined in > my application. So if a visitor tries to visit > "http:://www.yoursite.com/undefined" instead of "Routing error" they > will get my 404.html page. > > How can this be handled? Is there a way to setup something in > routes.rb > for all routes not defined and/or not controller/action? Thanks... > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ry an wrote:> I want to display the 404.html page for routes that are not defined in > my application. So if a visitor tries to visit > "http:://www.yoursite.com/undefined" instead of "Routing error" they > will get my 404.html page. > > How can this be handled? Is there a way to setup something in routes.rb > for all routes not defined and/or not controller/action? Thanks...Hi I think you place your application in production environment. when routes is not match then it gives 404.html page. so visitor get your default error message instead of routing error. Thanks Priyanka Pathak Software Engineer Gloscon Solution Pvt. Ltd. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---