title: Rails Routes based on condition
body: <p>I have three roles: Instuctor, Student, Admin and each have controllers with a "home" view.</p>
  
  <p>so this works fine,</p>
  
  <pre><code>get "instructor/home", :to =&gt; "instructor#home"
  get "student/home", :to =&gt; "student#home"
  get "admin/home", :to =&gt; "admin#home"
  </code></pre>
  
  <p>I want to write a vanity url like below which will route based on the role of the <code>user_id</code> to the correct home page.</p>
  
  <pre><code>get "/:user_id/home", :to =&gt; "instructor#home" or "student#home" or "admin#home"
  </code></pre>
  
  <p>How do I accomplish this?</p>