document attachment helper
This commit is contained in:
parent
b40d8ca224
commit
1996436204
17
README.rdoc
17
README.rdoc
|
@ -999,6 +999,23 @@ The <tt>request.body</tt> 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 <tt>find_template</tt> helper is used to find template files for rendering:
|
||||
|
|
Loading…
Reference in New Issue