1
votes

I have my emberjs code in the following jsbin,

http://emberjs.jsbin.com/rewumojixe

I am trying to have "search" resource nested inside my "cars" resource, as I want the route to be cars/search . I have used renderTemplate to load the search resource in the application outlet to replace the cars template rendered.

App.SearchRoute = Ember.Route.extend({
    renderTemplate: function () {
        this.render('search', { into: 'application' });
    }
});

This works fine except that on clicking back button on search route is loading a empty cars route.This happens only when the above renderTemplate code is added to the SearchRoute.

1

1 Answers

1
votes

If you don't want routes nested, don't nest them.

App.Router.map(function() {
    this.resource('home',   { path: '/' });
    this.resource('cars',   { path: '/cars' });
    this.resource('search', { path: '/cars/search' });
});

Demo: