Sha256: 2412681404a419638965aeaabc7d3ecbd4659eb4579cf50f6138cac15880dbcb

Contents?: true

Size: 405 Bytes

Versions: 1

Compression:

Stored size: 405 Bytes

Contents

module Flashlight
  module Concerns
    module Controllers
      module Flashing

        def self.included(base)
          base.after_filter :flash_to_cookie
        end

        def flash_to_cookie
          cookies[:flash] = nil if flash.empty? && cookies[:flash].present?
          return unless flash.any?
          cookies[:flash] = {:value => flash.to_json}
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flashlight-0.1 lib/flashlight/concerns/controllers/flashing.rb