Sha256: 1dc637aa13d19a04020d4be933a189d2816c55c0bb5feb5387030ef3d4b84880

Contents?: true

Size: 318 Bytes

Versions: 1

Compression:

Stored size: 318 Bytes

Contents

require "aflash/version"

module Aflash
  class Engine < ::Rails::Engine; end
  extend ActiveSupport::Concern

  included do
    after_filter :add_flash_to_header
  end

  private
  def add_flash_to_header
    return unless request.xhr?
    response.headers['X-Flash'] = flash.to_h.to_json
    flash.discard
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aflash-0.1.1 lib/aflash.rb