2011-07-12 114 views
0

我正在使用rails 3 + devise。當用戶註冊並出現錯誤時。該應用重定向到:ActionController :: RoutingError(沒有路由匹配「/ users」):

http://localhost:3000/users 

顯示錯誤消息,但在日誌中我看到以下內容:

Started POST "/users" for 127.0.0.1 at Mon Jul 11 20:22:19 -0700 2011 
    Processing by RegistrationsController#create as HTML 
    Parameters: {"commit"=>"Create my account", "fb_access_token"=>"XXXXX", "authenticity_token"=>"fWd/XXXX=", "utf8"=>"✓", "user"=>{"remember_me"=>"0", "lname"=>"XXXX", "fname"=>"XXXX", "password"=>"[FILTERED]", "email"=>"XXXX-inc.com"}, "fb_uuid"=>"312312"} 
    SQL (0.1ms) BEGIN 
    User Load (0.2ms) SELECT "users"."id" FROM "users" WHERE ("users"."email" = '[email protected]') LIMIT 1 
    SQL (0.2ms) ROLLBACK 
Rendered layouts/_header.html.erb (1.1ms) 
Rendered registrations/new.html.erb within layouts/unauthorized (11.3ms) 
Completed 200 OK in 45ms (Views: 22.6ms | ActiveRecord: 2.7ms) 


Started GET "/users" for 127.0.0.1 at Mon Jul 11 20:22:20 -0700 2011 

ActionController::RoutingError (No route matches "/users"): 


Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.8ms) 

的routes.rb:

# OmniAuth - for FB Connect 
    match '/users/auth/facebook/callback' => 'authentications#create' 

    # Devise 
    devise_for :users, :controllers => {:registrations => "registrations"} 

爲什麼ActionController的錯誤?

+0

請在這個控制器中顯示RegistrationsController和'new'動作的形式。 –

回答

0

rake routes顯示了什麼?由於Rails路由器選擇它匹配的第一條路由,所以放置路由的順序也很重要。

希望這會有所幫助!

相關問題