Skip to content

Instantly share code, notes, and snippets.

@domharrington
Created February 26, 2013 18:14
Show Gist options
  • Save domharrington/5040710 to your computer and use it in GitHub Desktop.
Save domharrington/5040710 to your computer and use it in GitHub Desktop.
Usage of model-not-found delegate in Catfish
var modelNotFoundDelegate = require('../lib/model-not-found-delegate')
, modelNotFound = modelNotFoundDelegate(router, collection, debug)
router.route('sections/:id/layout(/)', 'editLayout', function (id) {
collection.fetch(
{ update: true
, success: function () {
if (modelNotFound(id)) return false
var view = new LayoutView({ model: collection.get(id) })
router.render(view, 'Section Layout')
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment