Sha256: b85084a29a16bb7af80b93b1089ea4df20433d282413bc621b0bf2ca0511f224
Contents?: true
Size: 544 Bytes
Versions: 25
Compression:
Stored size: 544 Bytes
Contents
# Return 404 NOT FOUND response when requested file is not found in the database. # # This concern is to be included in serving controllers (Files/ImagesController). # module Neofiles::NotFound extend ActiveSupport::Concern include ActionController::Rescue included do rescue_from Mongoid::Errors::DocumentNotFound, with: :error_404 def error_404 self.response_body = I18n.t('neofiles.404_not_found') self.content_type = 'text/plain; charset=utf-8' self.status = 404 end private :error_404 end end
Version data entries
25 entries across 25 versions & 1 rubygems