From 1996436204e5ad0353b3c480d29d35936cdb609c Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Sun, 20 Feb 2011 15:49:36 +0100 Subject: [PATCH] document attachment helper --- README.rdoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.rdoc b/README.rdoc index 6e878783..0d408193 100644 --- a/README.rdoc +++ b/README.rdoc @@ -999,6 +999,23 @@ The request.body is an IO or StringIO object: "Hello #{data['name']}!" end +=== Attachments + +You can use the +attachment+ helper to tell the browser the response should be +stored on disk rather than displayed in the browser. + + get '/' do + attachment + "store it!" + end + +You can also pass it a file name: + + get '/' do + attachment "info.txt" + "store it!" + end + === Looking Up Template Files The find_template helper is used to find template files for rendering: