viatropos/tower — pull request #156 by edubkendo (2012-06-02 22:18:02+00:00)
Title: Flash messages

This pull request adds flash-messaging modeled loosely on a similar feature found in Rails and Express. The primary method involved, flash(), was in fact modeled quite closely on a similar method found in Express, though its use within a Tower application has more in common with the Rails version (the developer can simply use the feature, without needing to add dynamic helpers or additional templating).

To use, simply call the method from the controller with one of three types, "error", "success" or "info" along with a message to include. Call this before rendering the page.

The messages are currently templated in shared/_flash.coffee and styled, consistently with the rest of Tower, using Twitter-Bootstrap. Developers are, of course, free to change or remove the templating or styling as suits their particular needs. _flash.coffee is called?/rendered? from layouts/application.coffee so changes to it may need to be adjusted there as well. Will add example code and screenshots or links to screenshots to the wiki.