mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Handle /t/only-the-slug urls by trying to find the topic by slug (second try)
This commit is contained in:
@ -282,6 +282,7 @@ class ApplicationController < ActionController::Base
|
||||
@latest = f.order('views desc').take(10)
|
||||
@recent = f.order('created_at desc').take(10)
|
||||
@slug = params[:slug].class == String ? params[:slug] : ''
|
||||
@slug = (params[:id].class == String ? params[:id] : '') if @slug.blank?
|
||||
@slug.gsub!('-',' ')
|
||||
render status: status, layout: 'no_js', template: '/exceptions/not_found'
|
||||
end
|
||||
|
Reference in New Issue
Block a user