Rails wildcard route with database lookup & multiple controllers
问题 I have a Rails application setup where, after all of the other site routes are defined, I have a catch-all wildcard for my Users to display their Profiles on selected root-level "vanity" URLs of non-reserved paths/keywords: get '*path' => 'profiles#show' The Profiles controller then checks to make sure the path defines a valid Profile, otherwise redirects to root. This works fine. What I need to do now is create a mechanism where the catch-all path could define either a Profile or a Blog,