Added route to view test

This commit is contained in:
2025-07-14 13:53:50 -04:00
parent f3a2376c19
commit 65550c983c
3 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import (
type Test struct {
gorm.Model
DateTag string
Title string
// belongs to hardware
HardwareID int

View File

@ -1,7 +1,7 @@
{{ template "header" . }}
<div class="row">
<h2>{{ .test.Name }}</h2>
<h2>{{ .test.Title }}</h2>
<p>{{ .test.Description }}</p>

View File

@ -33,7 +33,7 @@ func TestGetView(c flamego.Context, t template.Template, data template.Data) {
models.DB.Find(&test, testID)
data["test"] = test
data["title"] = test.Name
data["title"] = test.Title
t.HTML(http.StatusOK, "test/view")
}