Interesing piece on The Pug Automatic about creative uses for the Rails `flash` function.  Although the implementations differ, the Ramaze version of `flash` will enable you to do much the same things.

I particularly like the idea of passing down "one off" event data to a JavaScript embed, so you can potentially fire of Google Analytics (or other) tracking messages on a one-off basis, without having to embed excessive controller style logic in your views.

A good reminder in the comments, as well, about not caching any views where you are likely to be using this, as people will either end up with other people's flashes, or stuck with the same flash for X minutes/hours.

Read more...