Sha256: 2b79e71416a906fbbc82693821b8c37c3d263a13f3ee3955504371d59fc35f43
Contents?: true
Size: 562 Bytes
Versions: 24
Compression:
Stored size: 562 Bytes
Contents
class Dispatcher constructor: -> @routes = { } initialize: -> body = $('body') controller = body.attr('id') action = body.attr('class') @dispatch('application', 'initialize') @dispatch('application', action) @dispatch(controller, 'initialize') @dispatch(controller, action) route: (amalgam, fn) -> [controller, action] = amalgam.split('#') @routes[controller] ?= { } @routes[controller][action] = fn dispatch: (controller, action) -> @routes[controller]?[action]?() APP.dispatcher = new Dispatcher
Version data entries
24 entries across 24 versions & 1 rubygems