RGJ
(Richard - Communiteq)
27 فبراير 2016، 11:05ص
1
We’re building a Sitemap plugin and I’m running into an issue.
(Yes there has been a lot of discussion around the need for a sitemap, but Google News totally requires it)
Somehow the code in the controller is never executed and I get the regular “The page you requested doesn’t exist or is private” message.
Because I suspected an issue with the view, I have stripped the code so it should only output a log line and an error, but this doesn’t work either.
Code is here:
https://github.com/communiteq/discourse-sitemap/blob/master/plugin.rb#L20-L26
Running it does this:
If I rename the generate
method or change the route, I get an error that the controller could not be found, so I should be on the right path here. Is there anyone who can spot (the probably very trivial) issue?
إعجابَين (2)
zogstrip
(Régis Hanol)
29 فبراير 2016، 11:48ص
2
Why do you have two routes for get "sitemap.xml"
?
RGJ
(Richard - Communiteq)
29 فبراير 2016، 12:23م
3
I have now monkey patched robots_txt to make it work, and commented out the part that references the engine.
This is the commit you should be looking at
إعجاب واحد (1)
EndruK
(André Karge)
13 أبريل 2016، 1:39م
4
Did you get it to work?
I got exactly the same problem, that my controller method code never gets called but the application knows the controller and his methods.
Regards
RGJ
(Richard - Communiteq)
13 أبريل 2016، 3:22م
5
No, I was never able to get that fixed
EndruK
(André Karge)
5 أغسطس 2016، 8:36ص
6
You need a client route as equivalent for a server route
https://meta.discourse.org/t/custom-home-page-to-discourse/12329/2?u=endruk
And on the client you have to call the server controller:
I’m not sure you can display views through controllers without an Ember route map. The only time I’ve called Ruby controller methods is through ajax calls. Take a look at the plugin how-to and look at the section where Robin talks about the route map.
Hope this helps you
إعجابَين (2)
RGJ
(Richard - Communiteq)
5 أغسطس 2016، 9:42ص
7
robots.txt is requested by search engine bots, not by the user.
So there is no need / use for an Ember route map…
إعجابَين (2)