Skip to content

Instantly share code, notes, and snippets.

@tadast
Created July 30, 2014 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadast/cb7618b26c7d5cd3d02a to your computer and use it in GitHub Desktop.
Save tadast/cb7618b26c7d5cd3d02a to your computer and use it in GitHub Desktop.
# As per https://github.com/alphasights/guides/pull/14
# Instead of
$ ->
if $('.js_money_index').length
# all your page-specific logic
# Use a [dispatcher](https://coderwall.com/p/mhvucw) with
# controllers/money_controller.js.coffee
class Internal.MoneyController
index: ->
new Internal.MoneyTableControls(".js_money_index")
# views/money_table_controls.js.coffee
Internal.MoneyTableControls
constructor: (selector) ->
@table = $(selector)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment