Hey guys,
I need a bit of help from someone familiar with creating routes in plugins.
I’ve created a plugin and have a route specified in my plugin.rb file like so:
register_asset 'javascripts/discourse/templates/user/route.hbs'
after_initialize do
Discourse::Application.routes.append do
get 'users/:username/route' => 'users#show', constraints: {username: USERNAME_ROUTE_FORMAT}
end
end
I also have a ‘*-route-map.js.es6’ file which declares this route like so:
export default function() {
this.resource('user', function() {
this.route('route', {path: 'route'});
});
}`
I literally want to create a route like ‘/users/:username/route’ but none of what I’m doing seems to be working and I’m getting the default 404 page when I go to that URL.
I’ve looked at how a few plugins do it such as the tagging one and I seem to be doing everything correctly so I can’t figure out where I’m going wrong. Can someone help please?