This has come up in a number of places so I decided to give it a go. I played around with it this morning. Try this:
https://github.com/Mittineague/discourse-newpage/pull/1
Edit:
I have a little more time now to explain. ![]()
The main difference I made was to change the route map. I could see that the route map code (discourse-newpage-route-map.js.es6) was running but the route code itself (/routes/newpage/index.js.es6) wasn’t. Looking at some of my other plugins (not yet public) I realized I normally use this pattern for page routes: /routes/newpage-index.js.es6 But that still didn’t solve everything.
So I suspected the Ruby routing as an issue since I couldn’t get a byebug to show me that the controller was firing. So I effectively recreated the entire routing and engine set up to follow my normal pattern. Calling /newpage.json worked so I figured that end was correct. But something was off with directing the route through the engine so I assigned the route to Discourse itself instead.
I can’t say that anything in particular was the magic bullet but the combination of renaming pieces on the Ember side and reconfiguring the Ruby side made it all work out.