func getBattleAnswerDisplay(db *mgo.Database, rec models.BattleAnswerRec) BattleAnswerDisplay { var display BattleAnswerDisplay var game models.GameRec display.Question = rec.Question display.Answer = rec.Answer display.State = rec.State display.SubmitterEmail = rec.SubmitterEmail display.Tags = strings.Join(rec.Tags, " ") rec.FindGame(db, &game) display.GameName = game.Name return display }
func BattleAnswersCreate(form BattleAnswerForm, r render.Render, db *mgo.Database, req *http.Request) { var rec models.BattleAnswerRec rec.GameId = form.GameId rec.Question = form.Question rec.Answer = form.Answer rec.State = form.State rec.SubmitterEmail = form.SubmitterEmail rec.Tags = strings.Split(form.Tags, " ") models.InsertBattleAnswer(db, rec) BattleAnswersIndex(r, db, req) }