Closed ravinggenius closed 13 years ago
It would be nice if generating a resource, like below, would create a dynamic helper for the view. This would be super useful for styling specific pages.
app.resource('forums', require('./forum'));
exports.index = function(req, res){ res.send('forum index'); }; // bodyClasses() //=> 'forums index' exports.new = function(req, res){ res.send('new forum'); }; // bodyClasses() //=> 'forums new' exports.create = function(req, res){ res.send('create forum'); }; // bodyClasses() //=> 'forums create' exports.show = function(req, res){ res.send('show forum ' + req.params.id); }; // bodyClasses() //=> 'forums show' exports.edit = function(req, res){ res.send('edit forum ' + req.params.id); }; // bodyClasses() //=> 'forums edit' exports.update = function(req, res){ res.send('update forum ' + req.params.id); }; // bodyClasses() //=> 'forums update' exports.destroy = function(req, res){ res.send('destroy forum ' + req.params.id); }; // bodyClasses() //=> 'forums destroy'
Any word on this?
i dont want to add body class support directly, that's too ad hoc but this will do the trick
https://github.com/visionmedia/express/commit/91997e9c53db057667981d5f5ece6eb15a8d1059
It would be nice if generating a resource, like below, would create a dynamic helper for the view. This would be super useful for styling specific pages.