Forum: Ruby on Rails routs question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2c49cd424ddb3b3c9cef6ef7f45c8534?d=identicon&s=25 Sam Ginko (ginkod)
on 2009-05-27 01:37
I would like to redirect a user to the index page  if they type in a
page that does not exist on my site. How do I go about that?
E37d44b8111e733527273f54c19fefc5?d=identicon&s=25 Darrik Mazey (Guest)
on 2009-05-27 03:13
(Received via mailing list)
Sam Ginko wrote:
> I would like to redirect a user to the index page  if they type in a
> page that does not exist on my site. How do I go about that?

The following as your last route, will catch any other requests that
don't match any other routes.

map.blanket_route '*path', :controller => 'whatever', :action =>
'some_action'

Hope that helps.

Darrik

--
Darrik Mazey
DarmaSoft, LLC.
1627 Marigold Avenue
Akron, Ohio 44301-2627
office: 330.983.9941
    fax: 330.983.9942
mobile: 330.808.2025
darrik@darmasoft.com

To obtain my public key, send an email to
darrik@publickey.darmasoft.com.
This topic is locked and can not be replied to.