0
我有更新我的route.rb
,如: -設計寶石中的路由錯誤?
devise_for :authorizes
devise_scope :authorizes do
get '/alogin' => 'devise/sessions#new'
get '/alogout' => 'devise/sessions#destroy'
end
devise_for :hrs
devise_scope :hrs do
get '/hlogin' => 'devise/sessions#new'
get '/hlogout' => 'devise/sessions#destroy'
end
devise_for :employes
devise_scope :employes do
get '/elogin' => 'devise/sessions#new'
get '/elogout' => 'devise/sessions#destroy'
end
錯誤
Could not find devise mapping for path "/alogin". This may happen for two reasons:
1) You forgot to wrap your route inside the scope block. For example: devise_scope :user do get "/some/route" => "some_devise_controller" end
2) You are testing a Devise controller bypassing the router. If so, you can explicitly tell Devise which mapping to use: @request.env["devise.mapping"] = Devise.mappings[:user]`