Пример #1
0
// search certain content
func Search(key string, c *revel.Controller) revel.Result {
	var problems []models.Problem
	err := engine.Where("title = ? ", key).Find(&problems)
	if err != nil {
		c.Flash.Error("error %s", err.Error())
		c.Redirect(routes.Notice.Crash())
	}
	return c.Render(problems)
}