Skip to content

Instantly share code, notes, and snippets.

@asalant
Created October 11, 2012 03:50
Show Gist options
  • Select an option

  • Save asalant/3870050 to your computer and use it in GitHub Desktop.

Select an option

Save asalant/3870050 to your computer and use it in GitHub Desktop.
Ubiquitous JS example: Browserify entry point
User = require '../shared/models/user'
UserEditView = require './views/user_edit_view'
$ ->
router = new Backbone.Router {
'users/:userId/edit': 'user-edit'
}
router.on 'route:user-edit', (userId) ->
user = new User(_id: userId)
user.fetch success: ->
router.show new UserEditView(user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment