Created
July 12, 2011 16:06
-
-
Save pacovell/1078292 to your computer and use it in GitHub Desktop.
Defines dynamicViewHelpers, included as per the server.js configuration also attached
This file contains 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
module.exports = function setup() { | |
var fns = {}, | |
methodName; | |
function makeHelperFunction(fn) { | |
return function(req, res) { | |
return fn; | |
}; | |
} | |
for(methodName in this.path) { | |
if (this.path.hasOwnProperty(methodName) && 'function' === typeof this.path[methodName]) { | |
fns[methodName] = makeHelperFunction(this.path[methodName]); | |
} | |
} | |
return fns; | |
}; |
This file contains 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
// TEMPORARY -- ideally will be included in the express-resource somewhere | |
app.resource.dynamicHelpers = require(process.cwd() + '/app/helpers/resourceful_urls'); | |
// Add dynamic helpers | |
app.dynamicHelpers(app.resource.dynamicHelpers()); |
This file contains 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
login= users_path() | |
a(href=forum_path(forum))= forum.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment