Ruby on rails 验证用户身份!劫持注册/创建方法

Ruby on rails 验证用户身份!劫持注册/创建方法,ruby-on-rails,ruby,devise,Ruby On Rails,Ruby,Devise,我遇到的问题似乎是Desive的身份验证(authenticate){role}!方法正在劫持我的注册尝试 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/dev

我遇到的问题似乎是Desive的身份验证(authenticate){role}!方法正在劫持我的注册尝试

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"=>"bacon@example.com", "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_,但似乎被忽略了

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

因此,就目前情况而言,用户首先不能注册到该网站。有什么想法吗?

您是否已检查以确保没有任何路由覆盖默认的设计路由/方法

由HaaR编辑,以明确存在类似问题的用户:

在我的design_for methods上方的config/routes.rb中有以下内容

match "client" => "wishes#index"
这是最重要的设计

devise_for :clients, :path => :client
通过将其移到下面,它将赋予designe优先级,并且仍然将get请求传递给适当的控制器和操作,而不会劫持POST请求