Render a flash div





4
Date Submitted Thu. Oct. 19th, 2006 4:36 PM
Revision 1 of 1
Beginner lagsalot
Tags rails
Comments 0 comments
This will render a flash div only if there is a message in flash. Also will set the id to the flash key.

flash[:notice] returns

This is the notice

def render_flash
    output = []
    for key,value in flash
      output << "<div id=\"#{key.to_s.downcase}\">#{value}</div>"
    end if flash
    output.join
  end
 

Brandt Lofton

Comments

There are currently no comments for this snippet.

Voting