Standardise flash messages across your app

July 19th, 2007 In the admin areas of apps I have been writing recently I've found myself writing the same block of code over and over. In these pretty mundane admin areas, after any action has completed or a rescue block has been triggered for ActiveRecord::RecordNotFound I like to show a quick "XXXXX Record Created" /"Could not find XXX with that ID" and then redirect people back to a safe place.

To solve my problem I created a double team-up of TextMate snippets and an addition to ActionController to make my coding quicker, and to standardise these messages across the whole app.

Read the rest of this entry