lib/controller.js
function(action) {
    var templateStr = fs.readFileSync(this.contrTemplates + action + '.js',
                                 {encoding: 'utf-8'});

    // rename template variables and append to controller file
    templateStr = require('./rename')(this.resName, templateStr);
    fs.appendFileSync(this.contrFile, templateStr);

    // add a route for new controller
    if (action !== 'create' && action !== 'update' && action !== 'destroy') {
      require('./router').appendRoute(this.resName, action);
      console.log('    Added Route: ' + this.resName + " " + action);
    }
  }
function(action) {
    var templateStr = fs.readFileSync(this.contrTemplates + action + '.js',
                                 {encoding: 'utf-8'});

    // rename template variables and append to controller file
    templateStr = require('./rename')(this.resName, templateStr);
    fs.appendFileSync(this.contrFile, templateStr);

    // add a route for new controller
    if (action !== 'create' && action !== 'update' && action !== 'destroy') {
      require('./router').appendRoute(this.resName, action);
      console.log('    Added Route: ' + this.resName + " " + action);
    }
  }
function ( action ) { var templateStr = fs . readFileSync ( this . contrTemplates + action + '.js' , { encoding : 'utf-8' } ) ; // rename template variables and append to controller file templateStr = require ( './rename' ) ( this . resName , templateStr ) ; fs . appendFileSync ( this . contrFile , templateStr ) ; // add a route for new controller if ( action !== 'create' && action !== 'update' && action !== 'destroy' ) { require ( './router' ) . appendRoute ( this . resName , action ) ; console . log ( '    Added Route: ' + this . resName + " " + action ) ; } }
Private: Streams controller template from templates folder, renames any template variables with `lib/rename.js`and appends the new processed template into user's controller folder `both/controller/posts.js`. If this file does not exist, it will be created. A route is appended to `routes.js`.  action - The {String} name of the controller action, eg index, show
Private : Streams controller template from templates folder renames any template variables with lib / rename . js and appends the new processed template into user s controller folder both / controller / posts . js . If this file does not exist it will be created . A route is appended to routes . js . action - The { String } name of the controller action eg index show