joebuhlig
(Joe Buhlig)
March 7, 2016, 8:24pm
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:
Previous tutorials in this series:
Part 1: Creating a basic plugin
Part 2: Plugin outlets
Part 3: Custom Settings
Part 4: git setup
Sometimes site settings aren’t enough of an admin interface for your plugin to work the way you want. For example, if you install the discourse-akismet plugin, you might have noticed that it adds a navigation item to the admin plugins section in of your Discourse:
[image]
In this tutorial we’ll show you how to add an admin interface for your plugin. I’m go…
https://meta.discourse.org/t/add-custom-route-from-initializer/36859
joebuhlig
(Joe Buhlig)
March 10, 2016, 5:33pm
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')
})
}
};
6 Likes