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.
Sam G. (Guest)
on 2009-05-27 03: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?
Darrik Mazey (Guest)
on 2009-05-27 05:13
(Received via mailing list)
Sam G. 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
removed_email_address@domain.invalid

To obtain my public key, send an email to
removed_email_address@domain.invalid.
This topic is locked and can not be replied to.