Return to Snippet

Revision: 9613
at November 14, 2008 07:06 by batamire


Updated Code
#FLASH_TYPES = [:error, :warning, :success, :message]

  def display_flash(type = nil)
    html = ""
    
    if type.nil?
      FLASH_TYPES.each { |name| html << display_flash(name) }
    else
      return flash[type].blank? ? "" : "<div class="#{type}"><p>#{flash[type]}</p></div>"
    end
    
    html
  end

Revision: 9612
at November 14, 2008 07:04 by batamire


Initial Code
  def display_flash(type = nil)
    html = ""
    
    if type.nil?
      FLASH_TYPES.each { |name| html << display_flash(name) }
    else
      return flash[type].blank? ? "" : "<div class="#{type}"><p>#{flash[type]}</p></div>"
    end
    
    html
  end

Initial URL

                                

Initial Description

                                

Initial Title
Rails flash messages helper

Initial Tags
textmate, flash

Initial Language
Rails