After successful create user
Model (for example) I need to redirect request to... for example root
page. But I wanna send message for ex. "User has been created!".
i can redirect with:
c.Redirect(http.StatusCreated, "/")
but how I can add message?
I tried (guess it was bad idea)
c.Set("message": "Message")
and in root page
s.MustGet("message")
but if root
page loads without payload message
it complain with panic
.
Pls suggest best way for redirection with data.
EDIT
Unfortunately c.Set()
doesn't work, guess it's because of redirect
.
Maybe some one suggest any tip to send data to redirect?