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.
Create a backend controller file plugins/quectel/app/controllers/quectel/examples_controller.rb
# frozen_string_literal: true
module ::Quectel
class ExamplesController < ::ApplicationController
requires_plugin PLUGIN_NAME
def hello
render json: { hello: "hello 2333" }
end
end
end
Define the backend route in plugins/quectel/config/routes.rb
# frozen_string_literal: true
Quectel::Engine.routes.draw do
get "/hello" => "examples#hello"
end
Discourse::Application.routes.draw { mount ::Quectel::Engine, at: "q" }
Visiting /q/hello will show the following display: