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