サインインして /users/edit にアクセスすると、次のエラーが表示されます。
No route matches {:action=>"show", :controller=>"users"}
users/edit が users コントローラーで show アクションを探しているのはなぜですか?
ルート.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