Exemplo n.º 1
0
func Edit(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	id := vars["id"]
	post_title := vars["title"]
	p := posts.GetSinglePost(id, post_title)
	controller.RenderTemplate(w, "edit-post", p)
}
Exemplo n.º 2
0
func Index(w http.ResponseWriter, r *http.Request) {
	p := posts.GetPosts()
	controller.RenderTemplate(w, "posts", p)
}
Exemplo n.º 3
0
func New(w http.ResponseWriter, r *http.Request) {
	collection := new(posts.Data)
	p := collection
	controller.RenderTemplate(w, "new-post", p)
}