I'm trying to create a Student Attendance web app. Currently have a struct
type Student struct {
StudentID int
StudentName string
Created time.Time
}
All student will be listed on list.html
func ListStudent(w http.ResponseWriter, r *http.Request) {
students := models.Student.ListAllUser()
render.HTML(w, http.StatusOK, "list.html", students)
}
list.html contain list of every students follows with Yes and No button for their attendance.
<p>#{{.StudentID}} {{.StudentName}}</p>
<a class="btn" role="button" href="/studentAttend/{{.StudentID}}">Yes</a>
<a class="btn" role="button" href="/studentAttend/{{.StudentID}}">No</a>
I'm struggle what the backend logic process to do with the button to store the students attendance. The idea is to have a request send to the server with Yes for True or No for False for student attendance that day.
The end goal is to have a table with row of students and column of each day of the month. The column day will have a tick for attend the school day and blank for the day absence along the student row.

?value=yesand?value=noto the two html buttons'hrefattributes. Then your handler for the/studentAttend/path can retrieve thevaluequery parameter from the request and do its logic based on that.