Saturday, September 27, 2008

Flash Alerts Plugin : flash_alerts_helper

A Helper for Flash Alerts

flash_alerts_helper

I find myself doing this over and again in every rails project I start.

Put flash alerts inside nice div boxes, and obviously not displaying anything at all if there's nothing to display, you know, if you display a div for the flash messages, but the message is empty, there's an empty blank line that moves everything down.

How to install

It's extremely simple, but it's easier to just install a plugin.

Do this:

git clone git://github.com/rha7dotcom/flash_alerts_helper.git vendor/plugins/flash_alerts_helper

Do that at the root of your rails project.

How to Use

Even simpler, just add the following at the approriate position in your rails layout.

<%= flash_alerts %>

And that's all, that will generate something like this:

Error Flash Message
Notice Flash Message

Git Repo

http://github.com/rha7dotcom/flash_alerts_helper/tree/master

Hope this is useful for someone out there, I really appreciate comments, so, reward me with yours.

Thanks and see you next time

0 comments: