I started going down the road of having a route that returns a collection of different models (i.e. collection contains App.Person, App.Place, App.Thing, etc.) I have been able to deal with this by providing a generic view that renders the appropriate template based on the context. Here is the basic idea:
App.SearchView = Ember.View.extend({
templateName:function(){
var item = this.get('context');// get the model
var itemName = item.constructor.toString();// get the type
if(itemName == "App.Person"){
return "personTemplate";// this is the name of the template
}
if(itemName == "App.Place"){
return "placeTemplate";
}
}.property().cacheable()
}
Is this the right thing to do with a collection that includes multiple model types? Or should I be using a different collection or technique?