作为设计和角度的新手,或许看错了地方,我似乎无法找到以下路线的参数记录位置:
$ rake routes
Prefix Verb URI Pattern Controller#Action
new_user_session GET /users/sign_in(.:format) user/sessions#new
user_session POST /users/sign_in(.:format) user/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) user/sessions#destroy
user_confirmation POST /users/confirmation(.:format) devise/confirmations#create
new_user_confirmation GET /users/confirmation/new(.:format) devise/confirmations#new
GET /users/confirmation(.:format) devise/confirmations#show
user_password POST /users/password(.:format) user/passwords#create
new_user_password GET /users/password/new(.:format) user/passwords#new
edit_user_password GET /users/password/edit(.:format) user/passwords#edit
PATCH /users/password(.:format) user/passwords#update
PUT /users/password(.:format) user/passwords#update
cancel_user_registration GET /users/cancel(.:format) user/registrations#cancel
user_registration POST /users(.:format) user/registrations#create
new_user_registration GET /users/sign_up(.:format) user/registrations#new
edit_user_registration GET /users/edit(.:format) user/registrations#edit
PATCH /users(.:format) user/registrations#update
PUT /users(.:format) user/registrations#update
DELETE /users(.:format) user/registrations#destroy
运行一段示例代码,我可以在日志中看到以下内容:
Started POST "/users/sign_in.json" for 127.0.0.1 at 2016-02-15 16:49:35 -0800
Processing by User::SessionsController#create as JSON
Parameters: {"user"=>{"email"=>"guest@local.host", "password"=>"[FILTERED]"}, "session"=>{"user"=>{"email"=>"guest@local.host", "password"=>"[FILTERED]"}}}
因为我没有每条路线的示例代码,我怎样才能找出上述路线的正确参数?感谢。