Extending nested resource routes


(Joe Buhlig) #1

I’m trying to learn Ember as I build for Discourse so forgive me if this is simple. I’m attempting to add a route underneath the userActivity resource. If I understand correctly, I should be able to do something along these lines:

export default {
  resource: 'user.userActivity',
  map() {
    this.route('votes');
  }
};

But that doesn’t do it. I’ve read through these two topics:


(Joe Buhlig) #2

For those that run into this issue, here’s what I found that seems to work:

export default {
  resource: 'user',
  path: 'users/:username',
  map() {
    this.resource('userActivity', {path: 'activity'}, function(){
      this.route('votes')
    })
  }
};