ember-addons / bootstrap-for-ember

Bootstrap for Ember.js
http://ember-addons.github.io/bootstrap-for-ember
Apache License 2.0
704 stars 103 forks source link

bs-tabs with nested resources #155

Closed ashrafhasson closed 10 years ago

ashrafhasson commented 10 years ago

Hi there,

I understand that the bs-tabs helper only supports nested routes as it's tab panes and treats the resource as the tab's container (so to speak), but when I have a nested resource like so

Router.map(function() {
    this.resource('settings', function() {
        this.route('logs');
        this.route('general');
        this.resource('users', function() {
            this.route('new');
            this.resource('user', {path: '/:user_id'}, function() {
                this.route('edit');
            });
        });
    });
});

how can I render the users resource into the users pane of the following configured tab:

App.SettingsController = Ember.Controller.extend({
    tabsMeta: [
        Ember.Object.create({title: 'General', linkTo: 'settings.general'}),
        Ember.Object.create({title: 'Users', linkTo: 'users'}),
        Ember.Object.create({title: 'Logs', linkTo: 'settings.logs'})
    ]
})

knowing that I've already tried preserving my routes namespace, e.g., with 'settings.users' in the router, but that didn't seem to help. While the route actually gets triggered and the content of my users array controller gets populated, nothing gets rendered into the users pane.

ashrafhasson commented 10 years ago

Apologies, the example above works fine with no problems. Namespace doesn't have to match and nested resources are being treated correctly, the problem was in my code and not in the part shown above. That been said, it's logically assumed/required that tab panes should be children routes/resources of the tab'ed resource.