Tom Taylor
2006-Mar-06 14:15 UTC
[Rails] Multiple actions for one route (making pretty URLs hit different actions)
Hi all, I''m trying to make pretty URLs using routes for some of my actions across different controllers. For example: http://www.example.com/london -> http://www.example.com/articles/show_by_name/london But if the id ''about'' couldn''t be found, then to search for it as another action, this time from the ''branch'' controller. http://www.example.com/london -> http://www.example.com/branches/show_by_name/london And so on, checking through different actions in different controllers, until it finds something that matches. How can I achieve this, preferably without building a specific controller/action to handle and forward requests to the appropriate pages? Thanks a lot! Tom