Created
February 26, 2013 18:14
-
-
Save domharrington/5040710 to your computer and use it in GitHub Desktop.
Usage of model-not-found delegate in Catfish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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