如何將你的路線映射到你的控制器方法

1.routes 中:

GET /books controllers.BooksController.index
GET /books/create controllers.BooksController.create()
GET /books/:id controllers.BooksController.show(id :Integer)
GET /books/edit/:id controllers.BooksController.edit(id:Integer)
POST /books/edit controllers.BooksController.update()
POST /books/create controllers.BooksController.save()
GET /books/delete/:id controllers.BooksController.destroy(id:Integer)

2.測試:localhost:9000/books,有迴應此時還沒有內容模型
發佈了132 篇原創文章 · 獲贊 35 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章