Closed dokun1 closed 6 years ago
This is the change I made in the completed food Tracker for my comment:
router.get("/foodtracker") { request, response, next in
defer {
next()
}
}
Meal.findAll { (result: [Meal]?, error: RequestError?) in
guard let meals = result else {
return
}
var allMeals: [String: [[String:Any]]] = ["meals" :[]]
for meal in meals {
allMeals["meals"]?.append(["name": meal.name, "rating": meal.rating])
}
}
response
.
Add the following line after the for meal in meals
loop:
Ok, I'll make a change in a little bit - handling expenses and admin stuff now that I'm back from Tokyo.
Now that the ORM instructions are live and required for the tutorial, the web frontend templating tutorial includes the use of the ORM.