diff --git a/ebook/13.5.md b/ebook/13.5.md index fd76d35d..226477a5 100644 --- a/ebook/13.5.md +++ b/ebook/13.5.md @@ -100,7 +100,7 @@ EditController } func (this *EditController) Get() { - id, _ := strconv.Atoi(this.Ctx.Input.Params(":id")) + id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" this.TplNames = "new.tpl" @@ -124,9 +124,9 @@ DeleteController } func (this *DeleteController) Get() { - id, _ := strconv.Atoi(this.Ctx.Input.Params(":id")) + id, _ := strconv.Atoi(this.Ctx.Input.Params(":id")) blog := GetBlog(id int) - this.Data["Post"] = blog + this.Data["Post"] = blog models.DelBlog(blog) this.Ctx.Redirect(302, "/") }