I have three independent designer models, I got three different sign_in screens. And all three have a dashboard:
devise_for :md1 devise_for :md2 devise_for :md3 match 'md1/dashboard' => 'md1#dashboard', :via => :get match 'md2/dashboard' => 'md2#dashboard', :via => :get match 'md3/dashboard' => 'md3#dashboard', :via => :get
I want it to be redirected to the mdX # control panel upon successful login to mdX, and if possible, GET. I tried:
devise_scope :md1 do root :to => 'md1#dashboard' end devise_scope :md2 do root :to => 'md2#dashboard' end devise_scope :md3 do root :to => 'md3#dashboard' end
Then, when I successfully enter md1, I am redirected to the md1 control panel, but when I successfully enter md2, I am redirected to the md1 sign_in screen. Then I tried:
def after_sign_in_path_for resource dashboard_path resource end
But there is no such method. Is there an easy way to do this or should it be with if for each model?
UPDATE
Some routes to better understand and get more information to get a better solution.
md1_dashboard GET /md1/dashboard(.:format) md1
thanks in advance
source share