I am trying to add a map.catchall entry to my routes.rb. I found this is the Rails book and changed it to my own specific controller and action: # Catch-all so we can gracefully handle badly-formed requests map.catchall "*anything", :controller => "home", :action => "index" When I try a known bad URL I get errors: undefined method `catchall'' for #<ActionController::Routing::RouteSet:0x403b40c4> config/routes.rb:23 config/routes.rb:1:in `draw'' config/routes.rb:1 Any idea what I might be doing wrong? Thanks, -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/
On Mon, Jul 04, 2005 at 09:34:50AM -0500, Greg Donald wrote:> I am trying to add a map.catchall entry to my routes.rb. I found this > is the Rails book and changed it to my own specific controller and > action: > > # Catch-all so we can gracefully handle badly-formed requests > map.catchall "*anything", > :controller => "home", > :action => "index" > > > When I try a known bad URL I get errors: > > undefined method `catchall'' for > #<ActionController::Routing::RouteSet:0x403b40c4> > > config/routes.rb:23 > config/routes.rb:1:in `draw'' > config/routes.rb:1 > > Any idea what I might be doing wrong?catchall in this case is a NamedRoute which as of *right now* is only available in svn trunk. The 0.13.0 release will include Named Routes and should be coming up today. I believe the beta gems have named routes in them. You could grab those or hold off until tonight (tomorrow?). marcel -- Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org>
On 7/4/05, Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org> wrote:> catchall in this case is a NamedRoute which as of *right now* is only > available in svn trunk. The 0.13.0 release will include Named Routes and > should be coming up today. I believe the beta gems have named routes in them. > You could grab those or hold off until tonight (tomorrow?).I now have Rails 0.13.> gem list --local|grep railsrails (0.13.0, 0.12.1) This same code in my routes.rb: map.catchall "*anything", :controller => "home", :action => "index" now says: File not found Change this error message for pages not found in public/404.html What do I need to do to make map.catchall work correctly? Thanks, -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/