mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
get rid of nonsense 404.html
correct 404 handling for invalid pages
This commit is contained in:
@ -1,14 +1,9 @@
|
||||
class ExceptionsController < ApplicationController
|
||||
skip_before_filter :check_xhr
|
||||
layout 'no_js'
|
||||
|
||||
def not_found
|
||||
f = Topic.where(deleted_at: nil, archetype: "regular")
|
||||
|
||||
@latest = f.order('views desc').take(10)
|
||||
@recent = f.order('created_at desc').take(10)
|
||||
@slug = params[:slug].class == String ? params[:slug] : ''
|
||||
@slug.gsub!('-',' ')
|
||||
render status: 404
|
||||
# centralize all rendering of 404 into app controller
|
||||
raise Discourse::NotFound
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user