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