The two routes of our application using the
GET verb (
Items.details) now return an HTML page. However, the remaining routes are not currently reachable by our web users. Web browsers can perform
POST requests only when an HTML form is submitted or if some client-side code sends an
Let's add an HTML page that contains a form to create new items, which will look like the following:
First, we need to define an HTTP endpoint for the page containing the form and then write the according route:
GET /items/add controllers.Items.createForm
Note that as routes are tried in their definition order, this ...