I am trying to add a custom route (non-admin route) discourse.
Required route http://discourse.org/customroute
I am able to add the route, but the problem is that instead of rendering the template, it just outputs the json text.
My json data in plugin.rb is
render json: {title:"custom route"}
My customroute-map.js.es6 contains
export default function() {
this.resource('customroute', { path: '/customroute' })
}
In the route/customroute.js.es6
export default Discourse.Route.extend({
model:function() {
return ajax('/customroute.json');
}
By doing so, I only get the json data in the template. But the customroute.hbs - handlebar template is not rendered.
I tried using the renderTemplate,
renderTemplate: function() {
this.render('/customroute');
}
But then I get the error "Assertion Failed: Cannot call
Ember.getwith an empty string"