Rails中的REST路由规则

来源:互联网 发布:龚德柏 知乎 编辑:程序博客网 时间:2024/05/17 08:32
HTTP 请求URL动作具名路由作用GET/usersindexusers_path显示所有用户的页面GET/users/1showuser_path(user)显示某个用户的页面GET/users/newnewnew_user_path创建(注册)新用户的页面POST/userscreateusers_path创建新用户GET/users/1/editeditedit_user_path(user)编辑 id 为 1 的用户页面PATCH/users/1updateuser_path(user)更新用户信息DELETE/users/1destroyuser_path(user)删除用户
原创粉丝点击