如何使第二条路线工作?
resources :users, only: [:edit, :update]
get ':id', :to => 'users#show', :as =>'user'
由于第二行,Rails 给出了错误:
Invalid route name, already in use: 'user' You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here: http://guides.rubyonrails.org/routing.html#restricting-the-routes-created