1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use tables for object properties and their purposes.

Enumeration lists with bipartite entries could be harder to read than
two-column tables.
This commit is contained in:
Andreas Scherer 2009-02-17 14:04:42 +01:00
parent d5376a247f
commit 5c4af59732

View file

@ -521,17 +521,18 @@ h4. The +request+ object
The request object contains a lot of useful information about the request coming in from the client. To get a full list of the available methods, refer to the "API documentation":http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html. Among the properties that you can access on this object are: The request object contains a lot of useful information about the request coming in from the client. To get a full list of the available methods, refer to the "API documentation":http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html. Among the properties that you can access on this object are:
* host - The hostname used for this request. |_.Property of +request+|_.Purpose|
* domain(n=2) - The hostname's first +n+ segments, starting from the right (the TLD) |host|The hostname used for this request.|
* format - The content type requested by the client. |domain(n=2)|The hostname's first +n+ segments, starting from the right (the TLD).|
* method - The HTTP method used for the request. |format|The content type requested by the client.|
* get?, post?, put?, delete?, head? - Returns true if the HTTP method is GET/POST/PUT/DELETE/HEAD. |method|The HTTP method used for the request.|
* headers - Returns a hash containing the headers associated with the request. |get?, post?, put?, delete?, head?|Returns true if the HTTP method is GET/POST/PUT/DELETE/HEAD.|
* port - The port number (integer) used for the request. |headers|Returns a hash containing the headers associated with the request.|
* protocol - Returns a string containing the protocol used plus "://", for example "http://" |port|The port number (integer) used for the request.|
* query_string - The query string part of the URL - everything after "?". |protocol|Returns a string containing the protocol used plus "://", for example "http://".|
* remote_ip - The IP address of the client. |query_string|The query string part of the URL, i.e., everything after "?".|
* url - The entire URL used for the request. |remote_ip|The IP address of the client.|
|url|The entire URL used for the request.|
h5. +path_parameters+, +query_parameters+, and +request_parameters+ h5. +path_parameters+, +query_parameters+, and +request_parameters+
@ -541,12 +542,13 @@ h4. The response object
The response object is not usually used directly, but is built up during the execution of the action and rendering of the data that is being sent back to the user, but sometimes - like in an after filter - it can be useful to access the response directly. Some of these accessor methods also have setters, allowing you to change their values. The response object is not usually used directly, but is built up during the execution of the action and rendering of the data that is being sent back to the user, but sometimes - like in an after filter - it can be useful to access the response directly. Some of these accessor methods also have setters, allowing you to change their values.
* body - This is the string of data being sent back to the client. This is most often HTML. |_.Property of +response+|_.Purpose|
* status - The HTTP status code for the response, like 200 for a successful request or 404 for file not found. |body|This is the string of data being sent back to the client. This is most often HTML.|
* location - The URL the client is being redirected to, if any. |status|The HTTP status code for the response, like 200 for a successful request or 404 for file not found.|
* content_type - The content type of the response. |location|The URL the client is being redirected to, if any.|
* charset - The character set being used for the response. Default is "utf-8". |content_type|The content type of the response.|
* headers - Headers used for the response. |charset|The character set being used for the response. Default is "utf-8".|
|headers|Headers used for the response.|
h5. Setting custom headers h5. Setting custom headers