RESTful routes

HTTP Request   URL       Action   Named             Route Purpose
GET       /users       index   users_path           page to list all users
GET       /users/1      show   user_path(1)          page to show user with id 1
GET       /users/new     new   new_user_path         page to make a new user (signup)
POST      /users       create   users_path          create a new user
GET       /users/1/edit    edit    edit_user_path(1)       page to edit user with id 1
PUT       /users/1      update   user_path(1)         update user with id 1
DELETE     /users/1      destroy   user_path(1)         delete user with id 1

 

 

users_path--->/users
user_path(@user)--->/users/1
new_user_path--->/users/new
edit_user_path(@user)--->/users/1/edit
users_url--->http://localhost:3000/users
user_url(@user)--->http://localhost:3000/users/1
new_user_url--->http://localhost:3000/users/new
edit_user_url(@user)--->http://localhost:3000/users/1/edit

posted on 2012-09-23 20:58  xbj746  阅读(166)  评论(0编辑  收藏  举报

导航