emberjs/ember.js — pull request #3281 by hyderali (2013-08-31 21:14:21+00:00)
Title: Adds the ability to specify viewClass for render

Right now templateName, controller, outlet and into can be passed to the render helper.
This adds the ability to pass viewClass also while rendering a template.

This will be useful in implementing modal views.

One fine example for modal views is @ahawkins [implementation](http://jsbin.com/elenaz/1/edit).
But here the problem is when to have more no.of modals in the application, then a dummy view have to be defined which has no specific logic, just extending the Modal view for the sake of template name alone, as in this
[example](http://jsbin.com/oPIMALo/2/edit).

Before this change,
```javascript
App.ApplicationRoute = Ember.Route.extend({
actions: {
open: function(name) {
this.render(name, { into: 'application', outlet: 'modal' });
},
open1: function() {
this.send('open','modal1');
},
open2: function() {
this.send('open','modal2');
},
open3: function() {
this.send('open','modal3');
},

close: function() {
this.render('nothing', { into: 'application', outlet: 'modal'});
},

save: function() {
alert('actions work like normal!');
}
}
});
App.ModalView = Ember.View.extend({
//Modal view logic here
});
App.Modal1View = App.ModalView.extend({});
App.Modal2View = App.ModalView.extend({});
App.Modal3View = App.ModalView.extend({});

```

After this change
```javascript
App.ApplicationRoute = Ember.Route.extend({
actions: {
open: function(name) {
this.render(name, { into: 'application', outlet: 'modal', viewClass:'modal' });
},
open1: function() {
this.send('open','modal1');
},
open2: function() {
this.send('open','modal2');
},
open3: function() {
this.send('open','modal3');
},

close: function() {
this.render('nothing', { into: 'application', outlet:'modal' });
},

save: function() {
alert('actions work like normal!');
}
}
});

```
No more need to create those dummy views