discourse/app/controllers/exceptions_controller.rb

15 lines
395 B
Ruby
Raw Normal View History

2013-02-06 03:16:51 +08:00
class ExceptionsController < ApplicationController
skip_before_filter :check_xhr
layout 'no_js'
def not_found
f = Topic.where(deleted_at: nil, archetype: "regular")
2013-02-07 23:45:24 +08:00
@popular = f.order('views desc').take(10)
2013-02-06 03:16:51 +08:00
@recent = f.order('created_at desc').take(10)
@slug = params[:slug].class == String ? params[:slug] : ''
@slug.gsub!('-',' ')
render status: 404
end
end