Deleting gridfs controller
This commit is contained in:
parent
511f571ae5
commit
0cff5a45a2
1 changed files with 0 additions and 15 deletions
|
|
@ -1,15 +0,0 @@
|
|||
class GridfsController < ActionController::Metal
|
||||
def serve
|
||||
gridfs_path = env["PATH_INFO"].gsub("/images/", "")
|
||||
begin
|
||||
gridfs_file = Mongo::GridFileSystem.new(MongoMapper.database).open(gridfs_path, 'r')
|
||||
self.response_body = gridfs_file.read
|
||||
self.content_type = gridfs_file.content_type
|
||||
rescue
|
||||
self.status = :file_not_found
|
||||
self.content_type = 'text/plain'
|
||||
self.response_body = "File totally imaginary #{gridfs_path}"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Reference in a new issue