Reputation: 810
I have two devise models in my routes.rb:
devise_for :practitioners, controllers: { sessions: "practitioners/sessions" }
devise_for :dashboard_accounts
I would like that doctor.mydomain.com/
maps to the login page of my practitioners.
I tried the following (the three commented blocks):
constraints(:subdomain => 'doctor') do
# FIRST BLOCK
# devise_scope :practitioners do
# root :to => 'practitioners/sessions#new'
# end
# SECOND BLOCK
# scope module: 'practitioners' do
# get '/' => 'practitioners/sessions#new'
# end
# THIRD BLOCK
# devise_scope :practitioners do
# get "/", to: "devise/sessions#new"
# end
end
But nothings works. How should I do it ?
Upvotes: 0
Views: 378
Reputation: 810
routes.rb :
devise_for :practitioners, controllers: { sessions: "practitioners/sessions" }
constraints(subdomain: /doctor*/) do
devise_scope :practitioner do
authenticated :practitioner do
root :to => 'practitioners/practitioner#index', as: :practitioner_root
end
unauthenticated :practitioner do
root :to => 'practitioners/sessions#new', as: :unauthenticated_root
end
end
end
Upvotes: 1