Skip to content

Instantly share code, notes, and snippets.

@hayes
Created January 9, 2013 07:49
Show Gist options
  • Save hayes/4491409 to your computer and use it in GitHub Desktop.
Save hayes/4491409 to your computer and use it in GitHub Desktop.
var Application = require('./application')
, User = compound.models.User;
var UserController = module.exports = function UserController(init) {
Application.call(this, init);
init.before(loadUser, {
only: ['show', 'edit', 'update', 'destroy']
});
};
require('util').inherits(UserController, Application);
UserController.prototype['new'] = function (req, res) {
this.title = 'New user';
this.user = new User;
res.flash('some message')
res.render();
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment