プラグインを作成し、以下のようにルートを追加しました。
./plugin.rb:
after_initialize do
load File.expand_path('../app/controllers/plugin_controller.rb', __FILE__)
Discourse::Application.routes.append do
get '/plugin' => 'plugin#index'
end
end
./assets/javascripts/discourse/plugin-route-map.js.es6:
export default function () {
this.route('plugin', { path: '/plugin' });
}
投稿内の https://discourse.sld.tld/plugin へのリンクをクリックすると 404 エラーが発生します。ただし、ブラウザで https://discourse.sld.tld/plugin を直接開くか、リンクを新しいタブ/ウィンドウで開く場合は正常に動作します。
投稿内のリンクが機能するようにするにはどうすればよいでしょうか?
ご支援をよろしくお願いいたします。