At the depot, an old screen hangs above the bikes. Margot would like to show the list of couriers on it, in big letters, so everyone knows who is riding today.
Your mission
- Add a
Tableaumethod (French for “board”) to the controller. It renders thetableau.tmplview, with two values:titre, set to"The Flying Gophers", andcoursiers, the list. - Wire it to
GET /boardinroutes/web.go. - In
resources/views/tableau.tmpl, show the title in an<h1>and in the page's<title>, then the list of couriers, one<li>per courier, inside a<ul>. The tests look for exactly<h1>The Flying Gophers</h1>and<li>Margot</li>: no attributes and no spaces inside these tags.
Reminder
Goravel renders its views with the templates from Go's standard library, html/template, where Laravel has Blade. Tags are written between double curly braces: {{ .titre }} prints a value, {{ range .coursiers }} … {{ end }} repeats a block for each item of a list, and {{ if … }} … {{ end }} shows one only under a condition.
Like {{ }} in Blade, html/template escapes what it prints: a first name that contained HTML would be shown as is, without being interpreted.
map[string]any is a map whose keys are strings and whose values can be of any type (any). That's what the view receives.