func ShowEditPostFormError(w http.ResponseWriter, params *ess.Command, err error) { w.Header().Set("Content-Type", "text/html; charset=utf-8") NewHTMLDocument("Edit Post", EditPostForm. Fill(params, err). Action("/posts/"+params.AggregateId()+"/edit"). Param("id", params.AggregateId()). Param("username", params.Get("username").String()). ToHTML("Edit post"), ).WriteHTML(w, "", " ") }
func PostFromCommand(params *ess.Command) ess.Aggregate { return NewPost(params.AggregateId()) }