func (this *CategoryRouter) NewSubmit() { form := post.CategoryForm{Locale: this.Locale} this.TplNames = "category/new.html" if !this.ValidFormSets(&form) { return } var category models.Category utils.SetFormValues(&form, &category) if err := category.Insert(); err == nil { this.Redirect(category.Link(), 302) } }