go - revel's .flash and .error -
i installed booking app , build small app myself , both suffer inability of displaying flash errors shown here: https://github.com/revel/revel/blob/master/samples/booking/app/views/hotels/settings.html
the example view use in own app https://gist.github.com/daemonfire300/10581488 , iterating on .error works fine.
am missing something?
i wrote controller (please note used default app instead of usercontroller use in example):
type user struct { username string password string email string } func (c app) register(user user) revel.result { c.validation.required(user.username).message("missing username") c.validation.required(user.password).message("missing password") c.validation.required(user.email).message("missing email") if c.validation.haserrors() { c.validation.keep() c.flashparams() } return c.redirect(app.index) }
when miss field on form (for example password), errors , previous fields' values restored, as shown here.
Comments
Post a Comment