In a plugin, how do I customize routes and then render a custom page?
I looked at this post: Developing Discourse Plugins - Part 5 - Add an Admin Interface - Docs / Developer Guide - Discourse Meta , and other plugins, but they all failed.
My custom routes are returning JSON data, but what I want is to render an Ember template. Is there a post that explains this related knowledge? Thank you very much.
merefield
(Robert)
16 december 2025 om 08:58
2
If that’s all you want to do, take a look at:
And:
Just to point out you can now display arbitrary pages within Discourse using the Landing Pages Plugin in combination with a couple of extensions:
3 likes
I am currently stuck here, here are my specific steps:
I defined the route in the file plugins/q/config/routes.rb:
get "/hello" => "examples#hello"
Controller: plugins/q/app/controllers/quectel/examples_controller.rb
def hello
render json: { hello: "world" }
end
Now visiting: localhost:4200/q/hello , returns json
{"hello":"world"}
How can I render the Ember template when visiting localhost:4200/q/q/hello ?
Moin
16 december 2025 om 10:02
5
I bookmarked this topic some time ago to read later: Creating Routes in Discourse and Showing Data . Not sure if it’s up-to-date, but maybe it’ll still help.
Yes, I also read this post and followed the steps above, but it didn’t work, and an “Page not found” error appeared. Then, I was confused.