func DeleteLink(ctx *middleware.Context, params martini.Params) { id := params["id"] link := new(model.Link) link.Id = ParseInt(id) err := link.Delete() PanicIf(err) ctx.Set("success", true) ctx.JSON(200, ctx.Response) }
func EditLink(ctx *middleware.Context, params martini.Params) { id := params["id"] link := new(model.Link) link.Id = ParseInt(id) err := link.GetLink() PanicIf(err) ctx.Set("Link", link) ctx.HTML(200, "link/edit", ctx) }