func (c OptionController) Remove(id int64) revel.Result { revel.TRACE.Printf("GET >> option.remove ... (%d)", id) c.Begin() var obj models.Option obj.ID = id count, err := c.Txn.Delete(&obj) if err != nil { c.Rollback() c.Flash.Error(err.Error()) return c.Redirect(routes.OptionController.Index()) } c.Commit() if count == 0 { c.Flash.Error("option (%d) not exist.", id) } else { c.Flash.Success("option (%d) remove succeed.", id) } return c.Redirect(routes.OptionController.Index()) }