Skip to content

A simple and unobtrusive way to intercept your flash calls in controllers and add before callbacks

License

Notifications You must be signed in to change notification settings

lshemesh/flash_interceptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlashInterceptor
===========

  This used to be a plugin for logging flash now its a more general purpose and simpler way to register callbacks
  with the use of flash

  it does this by overriding the ActionController flash method and returning a Flash like object that delegates back 
  to the original flash object.  It will send the callbacks to the controller when accessing the flash []= method passing
  along the flash message

  NOTE:  This code is not ready for production

Example
=======

  [ usage ]
    
    call before_flash in whatever controller you'd like to register callbacks for.  Alternatively you can place it in 
    application_controller if you want callbacks registered for all controllers

    Class ApplicationController < ActionController::Base

      before_flash :some_callback

    end


Copyright (c) 2011 [Leo Shemesh], released under the MIT license

About

A simple and unobtrusive way to intercept your flash calls in controllers and add before callbacks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages