我的 routes.rb 是跟随
resources :users
match 'users/login'
和耙路线显示
users GET /users(.:format) {:action=>"index", :controller=>"users"}
POST /users(.:format) {:action=>"create", :controller=>"users"}
new_user GET /users/new(.:format) {:action=>"new", :controller=>"users"}
edit_user GET /users/:id/edit(.:format) {:action=>"edit", :controller=>"users"}
user GET /users/:id(.:format) {:action=>"show", :controller=>"users"}
PUT /users/:id(.:format) {:action=>"update", :controller=>"users"}
DELETE /users/:id(.:format) {:action=>"destroy", :controller=>"users"}
users_login /users/login(.:format) {:controller=>"users", :action=>"login"}
但是当我这样做的时候
http://localhost:3000/users/login
它转到/user/show。我可以理解它为什么会发生,因为它在控制台上显示
Processing by UsersController#show as HTML
Parameters: {"id"=>"login"}
这怎么能解决。
恶作剧