Flash Notifications

temporary notifications to the user

A “flash notification” is a small message appearing on page load, and cleared before the next request. It’s rendered as a panel in the upper-right, contains a close button (no JS required), and fades away after a few seconds (JS required).

Usually you’ll want to set a flash at the end of a request, before a redirect.

1
2
// FlashAndRedir(success bool, msg string, redir string, w http.ResponseWriter, ps *cutil.PageState)
return controller.FlashAndRedir(true, msg, u, ps)

Alternately, you can add a flash manually by appending to the Flashes field of cutil.PageState in your controller action.