Search code examples
ember.jsdeprecatedember-router

Ember.js: renderTemplates gives DEPRECATED message in router definition


I just setup a router definition as follows

Sp.Router.map(function(match) {
    match('/').to('index');
});

Sp.IndexRoute = Ember.Route.extend({
    renderTemplates: function() {
        this.render('index');
    }
});

Although it works, I get the following warning:

DEPRECATION: Ember.Route.renderTemplates is deprecated. Please use Ember.Route.renderTemplate(controller, model) instead.

I don't really undertand what I should do to fix this ?


Solution

  • The answer is in the question: Please use Ember.Route.renderTemplate(controller, model) (singular form ;))

    related commits:

    https://github.com/emberjs/ember.js/commit/2468b42f801dc192a6e762293f3590d25274dfd0

    https://github.com/emberjs/ember.js/commit/6d771b7a9389fff826b8f2e500721da6a7ce2fc0

    Thanks to @klasspieter: The reasoning behind the change is explained here: https://github.com/emberjs/ember.js/pull/1693