每当我在登录时转到 /users/edit 时都会收到此错误:
No route matches {:action=>"show", :controller=>"users"}
为什么用户/编辑试图在用户控制器中查找显示操作?
路线.rb
devise_for :users do
get 'users', :to => 'users#show', :as => :user_root # Rails 3
end
resources :users, :only => [:index, :show]
authenticated :user do
root :to => 'home#index'
end
root :to => 'home#index'
耙路线:
user_root GET /users(.:format) users#show
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(.:forma 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
users GET /users(.:format) users#index
user GET /users/:id(.:format) users#show
root / home#index
root / home#index