How could i access topic by id only?


(Kkzhang) #1

In routes.rb, i discover

# Topics resource
get "t/:id" => "topics#show"

But actually, t/:id could not access the topic. Why and how?


How should short links be supported in Discourse
(Sam Saffron) #2

that looks like an overriden route. try

t/anything/:id to access it

I think we should fix it though, so recategorizing to bug.


(Kkzhang) #3

I do it. and the page redirect to t/:slug/:id

Another redirect is out of my expection.

Thanks.


(Sam Saffron) #4

This is not a bug, it was never implemented, I implemented the missing feature now so /t/16433 works now.

https://github.com/discourse/discourse/commit/49d03cf14e43fbf372fed93e24d408de2127cbef

The route was there as a fallback for “slug” lookups.


(Sam Saffron) #5