Sha256: a7cf1c57a3c60323164cfab5b364a9e6c887d65bf2efbe799bd3aaad9f211e69

Contents?: true

Size: 370 Bytes

Versions: 5

Compression:

Stored size: 370 Bytes

Contents

module FlashHelper
  
  ## This function will set a flash message depending up on the request type (ajax - xml http or direct http)
  ## example : store_flash_message("The message has been sent successfully", :success)
  def store_flash_message(message, type)
    if request.xhr?
      flash.now[type] = message
    else
      flash[type] = message
    end
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
humdrum-rails-0.1.3 lib/rails/generators/humdrum/layout/templates/helpers/flash_helper.rb
humdrum-rails-0.1.2 lib/rails/generators/humdrum/layout/templates/helpers/flash_helper.rb
humdrum-rails-0.1.1 lib/rails/generators/humdrum/layout/templates/helpers/flash_helper.rb
humdrum-rails-0.0.9 lib/rails/generators/humdrum/layout/templates/helpers/flash_helper.rb
humdrum-rails-0.0.8 lib/rails/generators/humdrum/layout/templates/helpers/flash_helper.rb