title: How can I redirect multiple devise model to multiple specific urls?
body: <p>I got three independent devise models, ergo I got three different sign_in screen. And all three have got a dashboard:</p>
  
  <pre><code>devise_for :md1
  devise_for :md2
  devise_for :md3
  
  match 'md1/dashboard' =&gt; 'md1#dashboard', :via =&gt; :get
  match 'md2/dashboard' =&gt; 'md2#dashboard', :via =&gt; :get
  match 'md3/dashboard' =&gt; 'md3#dashboard', :via =&gt; :get
  </code></pre>
  
  <p>I want when there is a mdX succesfully sign in, it will redirect to mdX#dashboard, and if it is possible by GET. I tried:</p>
  
  <pre><code>devise_scope :md1 do
    root :to =&gt; 'md1#dashboard'
  end
  devise_scope :md2 do
    root :to =&gt; 'md2#dashboard'
  end
  devise_scope :md3 do
    root :to =&gt; 'md3#dashboard'
  end
  </code></pre>
  
  <p>Then when I succesfully sign in with md1 I got redirected to md1 dashboard, but when I succesfully sign in with md2 I got redirected to md1's sign_in screen.
  Then I tried:</p>
  
  <pre><code>def after_sign_in_path_for resource
    dashboard_path resource
  end
  </code></pre>
  
  <p>But there isn't such method. Is there an easy way to do this or it has to be with the <code>if</code> statements for each model?</p>
  
  <h2>UPDATE</h2>
  
  <p>Some routes to make a better understanding and more information to get a better solution</p>
  
  <pre><code>md1_dashboard GET    /md1/dashboard(.:format)        md1#dashboard
  md2_dashboard GET    /md2/dashboard(.:format)        md2#dashboard
  md3_dashboard GET    /md3/dashboard(.:format)        md3#dashboard
  </code></pre>
  
  <p><strong>Thanks in advance</strong></p>