Clean & Pretty flash[:notice] and flash[:error] in Rails

I’ve been using this little snippet quite often for our Rails applications, so I thought I’d share it. It uses minimal code to output the flash[:notice] and flash[:error] messages in colors correlating to their purpose and then fades them away.

flash notice example

Here’s the CSS used followed by the Erb code I use in my layout:

3 Responses to “Clean & Pretty flash[:notice] and flash[:error] in Rails”

  1. Tim Jansson Says:

    Thanks, really nice :-)

  2. Leumas Says:

    There is also sexy_flash, but I can only find four effects that work and it is buggy with redirects and renders.

    I found this useful.
    Leumas

  3. cesar Says:

    Thanks, I used the style css of this tutorial for the message boxes:

    http://css.dzone.com/news/css-message-boxes-different-me

    and content_tag :span instead content_tag :div

    The result is very nice.

    Thanks again.

Leave a Reply