public/lib/emberjs/ember.js
function(name, model) {
        var container = this.container;

        model = model || this.modelFor(name);

        return generateController(container, name, model);
      }
function(name, model) {
        var container = this.container;

        model = model || this.modelFor(name);

        return generateController(container, name, model);
      }
function ( name , model ) { var container = this . container ; model = model || this . modelFor ( name ) ; return generateController ( container , name , model ) ; }
Generates a controller for a route.

If the optional model is passed then the controller type is determined automatically,
e.g., an ArrayController for arrays.

Example

```js
App.PostRoute = Ember.Route.extend({
setupController: function(controller, post) {
this._super(controller, post);
this.generateController('posts', post);
}
});
```

@method generateController
@param {String} name the name of the controller
@param {Object} model the model to infer the type of the controller (optional)
Generates a controller for a route .