lib/ramaze/helper/file.rb in ramaze-0.1.0 vs lib/ramaze/helper/file.rb in ramaze-0.1.1
- old
+ new
@@ -3,9 +3,12 @@
module Ramaze
module FileHelper
private
+ # Sets Content-Type to the mimetype of the file and opens the file you pass
+ # it, then throws :respond to finish off the request.
+
def send_file(file, mime_type = Tool::MIME.type_for(file))
response.header["Content-Type"] = mime_type
response.body = File.open(file)
throw(:respond)
end