app/helpers/application_helper.rb
# Output the flashes if they exist
Output the flashes if they exist
Output the flashes if they exist
def show_flash
    html = ''
    [ :alert, :notice, :info, :warning, :error ].each do |f|
      options = { :id => "flash-#{f}", :class => "flash-#{f}" }
      options.merge!( :style => 'display:none' ) if flash[f].nil?
      html << content_tag( 'div', options ) { flash[f] || '' }
    end
    html.html_safe
  end
def show_flash html = '' [ :alert , :notice , :info , :warning , :error ] . each do | f | options = { :id => "flash-#{f}" , :class => "flash-#{f}" } options . merge! ( :style => 'display:none' ) if flash [ f ] . nil? html << content_tag ( 'div' , options ) { flash [ f ] || '' } end html . html_safe end
Output the flashes if they exist
Output the flashes if they exist