documentation for rails event handling