Cho tên resource (số nhiều, vd posts), sinh ra 7 route REST chuẩn theo đúng thứ tự sau, mỗi dòng dạng METHOD PATH action:
GET /posts index
GET /posts/new new
POST /posts create
GET /posts/:id show
GET /posts/:id/edit edit
PUT /posts/:id update
DELETE /posts/:id destroy
(METHOD canh trái rộng 6, một khoảng trắng, rồi PATH, một khoảng trắng, rồi action — nhưng để đơn giản chỉ cần đúng METHOD PATH action cách nhau một khoảng trắng.)
Cho danh sách resource, in các route cho từng resource lần lượt.
Dòng 1: số nguyên R. R dòng: tên resource.
1 ≤ R ≤ 50.
Với mỗi resource, 7 dòng route theo thứ tự trên.
Ví dụ:
Đầu vào:
1
posts
Đầu ra:
GET /posts index
GET /posts/new new
POST /posts create
GET /posts/:id show
GET /posts/:id/edit edit
PUT /posts/:id update
DELETE /posts/:id destroy
Giải thích:
Đang tải editor...