10 ŞUBAT 2011, PERŞEMBE
Ayarı köküne sayfa için Hazırlamak
Benim güzergah için aşağıdaki kodu kullanıyorum:
devise_for :user,
:as => '',
:path_names => {
:sign_in => "",
:sign_out => "logout",
:sign_up => "register"
}
Ama oturum olduğumda ve aşağıdaki hatayı alıyorum /logout
ben önceki sayfalarda
Yol maçlar {:action=>"", yeni :kumanda=>"/oturumları planlamak"}
Nasıl :sign_in
eylem için kök yol Kur?
CEVAP
21 EKİM 2012, Pazar
Hata hakkında Could not find devise mapping for path "/"
soruyor insanlar takip için geçici bir çözüm.
Muhtemelen diyecekler ki günlükleri: bir ipucu olduğunu göreceksiniz
[Devise] Could not find devise mapping for path "/".
This may happen for two reasons:
1) You forgot to wrap your route inside the scope block. For example:
devise_scope :user do
match "/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]
Bu yaklaşım yeniden ama kaydırma @miccet suggets gibi) kapsam bloğu içinde yerine:
devise_scope :user do
root to: "devise/sessions#new"
end
Bu benim için iyi çalıştı
Bunu Paylaş:
Nasıl Jilet gibi bir ad almak için Say...
saf JavaScript jQuery eşdeğer'in ...
nasıl iFrame Ana Sayfa jquery kullanar...
Nasıl sayfa tüm modern tarayıcılarda y...
Nasıl geçerli sayfa MVC 3'te URL almak...