我是 Rails 新手,我无法通过设计来确定 Rails 3 中的路由
当我路由到用户页面时,我得到了这个丑陋的错误: http ://s9.postimage.org/nlyxhlk5b/Devise_routing.png
在我的路线中
#Resources for users
devise_for :users, :controllers => { :registrations => "registrations" }
resource :users do
get 'welcome'
end
这些是我的用户路线
更新
root / members#welcome
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
我应该没有 2 个用户资源吗?我相信他们可能会以某种方式发生冲突,或者我只是错过了什么?
更新
我忘了提到我正在覆盖默认的设计注册控制器
class RegistrationsController < Devise::RegistrationsController
protected
# Redirect to welcome page after a successful registration
def after_sign_up_path_for(resource)
'/users/welcome'
end
end