GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of lifo/doc-rails
Description: Repository for improving Rails documentation
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/zmalltalker/doc-rails.git
revised markup in AC::Streaming docs
Xavier Noria (author)
Thu Apr 10 14:08:52 -0700 2008
commit  6c22ff9b5b3c7506c7b8e47b642ba1f6c216110c
tree    b3f4c3e8d47ad00b0c4b58ba3a212066b5d70cd3
parent  708da65852619797588a1b8e6a770e686b9b4869
...
17
18
19
20
 
21
22
23
24
25
 
26
27
28
29
30
31
 
 
32
33
34
35
 
36
37
 
38
39
40
...
42
43
44
 
45
46
47
 
48
49
50
 
51
52
53
54
55
 
 
56
57
58
...
95
96
97
98
 
99
100
101
...
103
104
105
 
106
107
108
 
109
110
111
 
112
113
114
...
17
18
19
 
20
21
22
23
24
 
25
26
27
28
29
 
 
30
31
32
33
34
 
35
36
 
37
38
39
40
...
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
 
57
58
59
60
61
...
98
99
100
 
101
102
103
104
...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
0
@@ -17,24 +17,24 @@ module ActionController #:nodoc:
0
       # it feasible to send even large files.
0
       #
0
       # Be careful to sanitize the path parameter if it coming from a web
0
- # page. send_file(params[:path]) allows a malicious user to
0
+ # page. <tt>send_file(params[:path])</tt> allows a malicious user to
0
       # download any file on your server.
0
       #
0
       # Options:
0
       # * <tt>:filename</tt> - suggests a filename for the browser to use.
0
- # Defaults to File.basename(path).
0
+ # Defaults to <tt>File.basename(path)</tt>.
0
       # * <tt>:type</tt> - specifies an HTTP content type.
0
       # Defaults to 'application/octet-stream'.
0
       # * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded.
0
       # Valid values are 'inline' and 'attachment' (default).
0
- # * <tt>:stream</tt> - whether to send the file to the user agent as it is read (true)
0
- # or to read the entire file before sending (false). Defaults to true.
0
+ # * <tt>:stream</tt> - whether to send the file to the user agent as it is read (+true+)
0
+ # or to read the entire file before sending (+false+). Defaults to +true+.
0
       # * <tt>:buffer_size</tt> - specifies size (in bytes) of the buffer used to stream the file.
0
       # Defaults to 4096.
0
       # * <tt>:status</tt> - specifies the status code to send with the response. Defaults to '200 OK'.
0
- # * <tt>:url_based_filename</tt> - set to true if you want the browser guess the filename from
0
+ # * <tt>:url_based_filename</tt> - set to +true+ if you want the browser guess the filename from
0
       # the URL, which is necessary for i18n filenames on certain browsers
0
- # (setting :filename overrides this option).
0
+ # (setting <tt>:filename</tt> overrides this option).
0
       #
0
       # The default Content-Type and Content-Disposition headers are
0
       # set to download arbitrary binary files in as many browsers as
0
@@ -42,17 +42,20 @@ module ActionController #:nodoc:
0
       # a variety of quirks (especially when downloading over SSL).
0
       #
0
       # Simple download:
0
+ #
0
       # send_file '/path/to.zip'
0
       #
0
       # Show a JPEG in the browser:
0
+ #
0
       # send_file '/path/to.jpeg', :type => 'image/jpeg', :disposition => 'inline'
0
       #
0
       # Show a 404 page in the browser:
0
+ #
0
       # send_file '/path/to/404.html', :type => 'text/html; charset=utf-8', :status => 404
0
       #
0
       # Read about the other Content-* HTTP headers if you'd like to
0
- # provide the user with more information (such as Content-Description).
0
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
0
+ # provide the user with more information (such as Content-Description) in
0
+ # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11.
0
       #
0
       # Also be aware that the document may be cached by proxies and browsers.
0
       # The Pragma and Cache-Control headers declare how the file may be cached
0
@@ -95,7 +98,7 @@ module ActionController #:nodoc:
0
       # and specify whether to show data inline or download as an attachment.
0
       #
0
       # Options:
0
- # * <tt>:filename</tt> - Suggests a filename for the browser to use.
0
+ # * <tt>:filename</tt> - suggests a filename for the browser to use.
0
       # * <tt>:type</tt> - specifies an HTTP content type.
0
       # Defaults to 'application/octet-stream'.
0
       # * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded.
0
@@ -103,12 +106,15 @@ module ActionController #:nodoc:
0
       # * <tt>:status</tt> - specifies the status code to send with the response. Defaults to '200 OK'.
0
       #
0
       # Generic data download:
0
+ #
0
       # send_data buffer
0
       #
0
       # Download a dynamically-generated tarball:
0
+ #
0
       # send_data generate_tgz('dir'), :filename => 'dir.tgz'
0
       #
0
       # Display an image Active Record in the browser:
0
+ #
0
       # send_data image.data, :type => image.content_type, :disposition => 'inline'
0
       #
0
       # See +send_file+ for more information on HTTP Content-* headers and caching.

Comments

    No one has commented yet.