-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
28 lines (17 loc) · 886 Bytes
/
README
File metadata and controls
28 lines (17 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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