2012-01-14 1 views
1

내가 겪고있는 문제는 Devise가 _ # {role}을 (를) 인증하는 것 같습니다! 메소드가 내 등록 시도를 가로 채고 있습니다.authenticate_user! 등록 하이재킹/방법 생성

Started GET "/client/sign_up" for 127.0.0.1 at 2012-01-14 12:02:52 +0000 
    Processing by Client::RegistrationsController#new as HTML 
Rendered /Users/robertwwhite/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.5.3/app/views/devise/shared/_links.erb (1.4ms) 
Rendered client/registrations/new.html.haml within layouts/application (97.6ms) 
Rendered client/_navigation.html.haml (1.6ms) 
Rendered shared/_flash_messages.html.haml (0.1ms) 
Completed 200 OK in 126ms (Views: 116.4ms | ActiveRecord: 7.2ms) 

Started POST "/client" for 127.0.0.1 at 2012-01-14 12:02:58 +0000 
    Processing by WishesController#index as HTML 
    Parameters: {"utf8"=>"✓", "authenticity_token"=>"vq3wgsQeb4eoxhb3sw2Q2kd4edIoOxIfrzJ/WzJUAn0=", "client"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"} 
Completed 401 Unauthorized in 13ms 

Started GET "/client/sign_in" for 127.0.0.1 at 2012-01-14 12:02:58 +0000 
    Processing by Client::SessionsController#new as HTML 
Rendered /Users/robertwwhite/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.5.3/app/views/devise/shared/_links.erb (1.0ms) 
Rendered client/sessions/new.html.haml within layouts/application (16.5ms) 
Rendered client/_navigation.html.haml (1.5ms) 
Rendered shared/_flash_messages.html.haml (0.3ms) 
Completed 200 OK in 60ms (Views: 38.6ms | ActiveRecord: 6.4ms) 

은 내가 after_signup_path_for (resource_or_scope를) 재정의 해봤지만 무시지고있는 것 같다.

# app/controllers/application_controller.rb 
def after_sign_up_path_for(resource_or_scope) 
    random_path 
end 

그래서 사용자는 처음부터 사이트에 등록 할 수 없습니다. 어떤 아이디어?

답변

2

경로가 기본 경로/메소드를 재정의하지 않았는지 확인 했습니까?

는 비슷한 문제를 가진 사용자의 명확성을 위해 하르에 의해 편집 :

내가 내 devise_for 방법 위의 내 설정/routes.rb에서 다음했다. 무시했다

match "client" => "wishes#index" 

고안의 아래 이동하여

devise_for :clients, :path => :client 

, 그것은 고안 우선 순위를 제공하고, 여전히 POST 요청을 납치하지 않고 적절한 컨트롤러와 액션에 GET 요청을 전달합니다.

관련 문제