public
Description: PLEASE CHECK http://github.com/lifo/docrails/wikis
Homepage: http://weblog.rubyonrails.org/2008/5/2/help-improve-rails-documentation-on-git-branch
Clone URL: git://github.com/lifo/docrails.git
Merge docrails
lifo (author)
Wed Sep 03 09:58:47 -0700 2008
commit  6ef35461dc7148ce37ed602d65a24f6c883fd044
tree    c190505eaa8b98b4fcae4403bdd4776957d07785
parent  10fe6a6d8940300dd6698ec38e9c9573404e687d
...
38
39
40
41
42
 
 
43
44
45
...
38
39
40
 
 
41
42
43
44
45
0
@@ -38,8 +38,8 @@ module ActionController #:nodoc:
0
     # caches_action :show, :cache_path => { :project => 1 }, :expires_in => 1.hour
0
     # caches_action :feed, :cache_path => Proc.new { |controller|
0
     # controller.params[:user_id] ?
0
- # controller.send(:user_list_url, c.params[:user_id], c.params[:id]) :
0
- # controller.send(:list_url, c.params[:id]) }
0
+ # controller.send(:user_list_url, controller.params[:user_id], controller.params[:id]) :
0
+ # controller.send(:list_url, controller.params[:id]) }
0
     # end
0
     #
0
     # If you pass :layout => false, it will only cache your action content. It is useful when your layout has dynamic information.
...
22
23
24
25
 
26
27
28
...
32
33
34
35
 
36
37
38
...
59
60
61
62
63
 
 
64
65
66
67
68
69
 
 
70
71
72
73
74
 
75
76
77
...
79
80
81
82
 
83
84
85
86
87
88
89
 
90
91
92
...
123
124
125
126
 
127
128
129
...
142
143
144
145
146
 
 
147
148
149
...
159
160
161
162
 
163
164
165
...
190
191
192
193
 
194
195
196
...
237
238
239
240
 
241
242
243
244
245
246
 
247
248
249
...
254
255
256
 
257
258
259
...
268
269
270
271
272
 
 
273
274
275
...
285
286
287
288
 
289
290
291
...
293
294
295
296
297
 
 
298
299
300
301
302
 
303
304
305
...
307
308
309
310
311
 
 
 
312
313
314
...
316
317
318
319
 
320
321
322
...
326
327
328
329
 
330
331
332
...
352
353
354
355
 
 
356
357
358
...
362
363
364
365
 
366
367
368
...
372
373
374
375
 
376
377
378
...
382
383
384
385
 
386
387
388
389
390
391
392
393
 
 
394
395
 
 
396
397
398
...
22
23
24
 
25
26
27
28
...
32
33
34
 
35
36
37
38
...
59
60
61
 
 
62
63
64
65
66
67
68
 
69
70
71
72
73
74
75
76
77
78
79
...
81
82
83
 
84
85
86
87
88
89
90
 
91
92
93
94
...
125
126
127
 
128
129
130
131
...
144
145
146
 
 
147
148
149
150
151
...
161
162
163
 
164
165
166
167
...
192
193
194
 
195
196
197
198
...
239
240
241
 
242
243
244
245
246
247
 
248
249
250
251
...
256
257
258
259
260
261
262
...
271
272
273
 
 
274
275
276
277
278
...
288
289
290
 
291
292
293
294
...
296
297
298
 
 
299
300
301
302
303
304
 
305
306
307
308
...
310
311
312
 
 
313
314
315
316
317
318
...
320
321
322
 
323
324
325
326
...
330
331
332
 
333
334
335
336
...
356
357
358
 
359
360
361
362
363
...
367
368
369
 
370
371
372
373
...
377
378
379
 
380
381
382
383
...
387
388
389
 
390
391
392
393
394
 
 
 
 
395
396
397
398
399
400
401
402
403
0
@@ -22,7 +22,7 @@ module ActionController
0
     # such as { 'RAILS_ENV' => 'production' }.
0
     attr_reader :env
0
 
0
- # The true HTTP request method as a lowercase symbol, such as <tt>:get</tt>.
0
+ # The true HTTP request \method as a lowercase symbol, such as <tt>:get</tt>.
0
     # UnknownHttpMethod is raised for invalid methods not listed in ACCEPTED_HTTP_METHODS.
0
     def request_method
0
       method = @env['REQUEST_METHOD']
0
@@ -32,7 +32,7 @@ module ActionController
0
     end
0
     memoize :request_method
0
 
0
- # The HTTP request method as a lowercase symbol, such as <tt>:get</tt>.
0
+ # The HTTP request \method as a lowercase symbol, such as <tt>:get</tt>.
0
     # Note, HEAD is returned as <tt>:get</tt> since the two are functionally
0
     # equivalent from the application's perspective.
0
     def method
0
@@ -59,19 +59,21 @@ module ActionController
0
       request_method == :delete
0
     end
0
 
0
- # Is this a HEAD request? <tt>request.method</tt> sees HEAD as <tt>:get</tt>,
0
- # so check the HTTP method directly.
0
+ # Is this a HEAD request? Since <tt>request.method</tt> sees HEAD as <tt>:get</tt>,
0
+ # this \method checks the actual HTTP \method directly.
0
     def head?
0
       request_method == :head
0
     end
0
 
0
     # Provides access to the request's HTTP headers, for example:
0
- # request.headers["Content-Type"] # => "text/plain"
0
+ #
0
+ # request.headers["Content-Type"] # => "text/plain"
0
     def headers
0
       ActionController::Http::Headers.new(@env)
0
     end
0
     memoize :headers
0
 
0
+ # Returns the content length of the request as an integer.
0
     def content_length
0
       @env['CONTENT_LENGTH'].to_i
0
     end
0
@@ -79,14 +81,14 @@ module ActionController
0
 
0
     # The MIME type of the HTTP request, such as Mime::XML.
0
     #
0
- # For backward compatibility, the post format is extracted from the
0
+ # For backward compatibility, the post \format is extracted from the
0
     # X-Post-Data-Format HTTP header if present.
0
     def content_type
0
       Mime::Type.lookup(content_type_without_parameters)
0
     end
0
     memoize :content_type
0
 
0
- # Returns the accepted MIME type for the request
0
+ # Returns the accepted MIME type for the request.
0
     def accepts
0
       header = @env['HTTP_ACCEPT'].to_s.strip
0
 
0
@@ -123,7 +125,7 @@ module ActionController
0
       not_modified?(response.last_modified) || etag_matches?(response.etag)
0
     end
0
 
0
- # Returns the Mime type for the format used in the request.
0
+ # Returns the Mime type for the \format used in the request.
0
     #
0
     # GET /posts/5.xml | request.format => Mime::XML
0
     # GET /posts/5.xhtml | request.format => Mime::HTML
0
@@ -142,8 +144,8 @@ module ActionController
0
     end
0
 
0
 
0
- # Sets the format by string extension, which can be used to force custom formats that are not controlled by the extension.
0
- # Example:
0
+ # Sets the \format by string extension, which can be used to force custom formats
0
+ # that are not controlled by the extension.
0
     #
0
     # class ApplicationController < ActionController::Base
0
     # before_filter :adjust_format_for_iphone
0
@@ -159,7 +161,7 @@ module ActionController
0
     end
0
 
0
     # Returns a symbolized version of the <tt>:format</tt> parameter of the request.
0
- # If no format is given it returns <tt>:js</tt>for AJAX requests and <tt>:html</tt>
0
+ # If no \format is given it returns <tt>:js</tt>for Ajax requests and <tt>:html</tt>
0
     # otherwise.
0
     def template_format
0
       parameter_format = parameters[:format]
0
@@ -190,7 +192,7 @@ module ActionController
0
     # the right-hand-side of X-Forwarded-For
0
     TRUSTED_PROXIES = /^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\./i
0
 
0
- # Determine originating IP address. REMOTE_ADDR is the standard
0
+ # Determines originating IP address. REMOTE_ADDR is the standard
0
     # but will fail if the user is behind a proxy. HTTP_CLIENT_IP and/or
0
     # HTTP_X_FORWARDED_FOR are set by proxies so check for these if
0
     # REMOTE_ADDR is a proxy. HTTP_X_FORWARDED_FOR may be a comma-
0
@@ -237,13 +239,13 @@ EOM
0
     memoize :server_software
0
 
0
 
0
- # Returns the complete URL used for this request
0
+ # Returns the complete URL used for this request.
0
     def url
0
       protocol + host_with_port + request_uri
0
     end
0
     memoize :url
0
 
0
- # Return 'https://' if this is an SSL request and 'http://' otherwise.
0
+ # Returns 'https://' if this is an SSL request and 'http://' otherwise.
0
     def protocol
0
       ssl? ? 'https://' : 'http://'
0
     end
0
@@ -254,6 +256,7 @@ EOM
0
       @env['HTTPS'] == 'on' || @env['HTTP_X_FORWARDED_PROTO'] == 'https'
0
     end
0
 
0
+ # Returns the \host for this request, such as "example.com".
0
     def raw_host_with_port
0
       if forwarded = env["HTTP_X_FORWARDED_HOST"]
0
         forwarded.split(/,\s?/).last
0
@@ -268,8 +271,8 @@ EOM
0
     end
0
     memoize :host
0
 
0
- # Returns a host:port string for this request, such as example.com or
0
- # example.com:8080.
0
+ # Returns a \host:\port string for this request, such as "example.com" or
0
+ # "example.com:8080".
0
     def host_with_port
0
       "#{host}#{port_string}"
0
     end
0
@@ -285,7 +288,7 @@ EOM
0
     end
0
     memoize :port
0
 
0
- # Returns the standard port number for this request's protocol
0
+ # Returns the standard \port number for this request's protocol.
0
     def standard_port
0
       case protocol
0
         when 'https://' then 443
0
@@ -293,13 +296,13 @@ EOM
0
       end
0
     end
0
 
0
- # Returns a port suffix like ":8080" if the port number of this request
0
- # is not the default HTTP port 80 or HTTPS port 443.
0
+ # Returns a \port suffix like ":8080" if the \port number of this request
0
+ # is not the default HTTP \port 80 or HTTPS \port 443.
0
     def port_string
0
       port == standard_port ? '' : ":#{port}"
0
     end
0
 
0
- # Returns the domain part of a host, such as rubyonrails.org in "www.rubyonrails.org". You can specify
0
+ # Returns the \domain part of a \host, such as "rubyonrails.org" in "www.rubyonrails.org". You can specify
0
     # a different <tt>tld_length</tt>, such as 2 to catch rubyonrails.co.uk in "www.rubyonrails.co.uk".
0
     def domain(tld_length = 1)
0
       return nil unless named_host?(host)
0
@@ -307,8 +310,9 @@ EOM
0
       host.split('.').last(1 + tld_length).join('.')
0
     end
0
 
0
- # Returns all the subdomains as an array, so ["dev", "www"] would be returned for "dev.www.rubyonrails.org".
0
- # You can specify a different <tt>tld_length</tt>, such as 2 to catch ["www"] instead of ["www", "rubyonrails"]
0
+ # Returns all the \subdomains as an array, so <tt>["dev", "www"]</tt> would be
0
+ # returned for "dev.www.rubyonrails.org". You can specify a different <tt>tld_length</tt>,
0
+ # such as 2 to catch <tt>["www"]</tt> instead of <tt>["www", "rubyonrails"]</tt>
0
     # in "www.rubyonrails.co.uk".
0
     def subdomains(tld_length = 1)
0
       return [] unless named_host?(host)
0
@@ -316,7 +320,7 @@ EOM
0
       parts[0..-(tld_length+2)]
0
     end
0
 
0
- # Return the query string, accounting for server idiosyncrasies.
0
+ # Returns the query string, accounting for server idiosyncrasies.
0
     def query_string
0
       if uri = @env['REQUEST_URI']
0
         uri.split('?', 2)[1] || ''
0
@@ -326,7 +330,7 @@ EOM
0
     end
0
     memoize :query_string
0
 
0
- # Return the request URI, accounting for server idiosyncrasies.
0
+ # Returns the request URI, accounting for server idiosyncrasies.
0
     # WEBrick includes the full URL. IIS leaves REQUEST_URI blank.
0
     def request_uri
0
       if uri = @env['REQUEST_URI']
0
@@ -352,7 +356,8 @@ EOM
0
     end
0
     memoize :request_uri
0
 
0
- # Returns the interpreted path to requested resource after all the installation directory of this application was taken into account
0
+ # Returns the interpreted \path to requested resource after all the installation
0
+ # directory of this application was taken into account.
0
     def path
0
       path = (uri = request_uri) ? uri.split('?').first.to_s : ''
0
 
0
@@ -362,7 +367,7 @@ EOM
0
     end
0
     memoize :path
0
 
0
- # Read the request body. This is useful for web services that need to
0
+ # Read the request \body. This is useful for web services that need to
0
     # work with raw requests directly.
0
     def raw_post
0
       unless env.include? 'RAW_POST_DATA'
0
@@ -372,7 +377,7 @@ EOM
0
       env['RAW_POST_DATA']
0
     end
0
 
0
- # Returns both GET and POST parameters in a single hash.
0
+ # Returns both GET and POST \parameters in a single hash.
0
     def parameters
0
       @parameters ||= request_parameters.merge(query_parameters).update(path_parameters).with_indifferent_access
0
     end
0
@@ -382,17 +387,17 @@ EOM
0
       @symbolized_path_parameters = @parameters = nil
0
     end
0
 
0
- # The same as <tt>path_parameters</tt> with explicitly symbolized keys
0
+ # The same as <tt>path_parameters</tt> with explicitly symbolized keys.
0
     def symbolized_path_parameters
0
       @symbolized_path_parameters ||= path_parameters.symbolize_keys
0
     end
0
 
0
- # Returns a hash with the parameters used to form the path of the request.
0
- # Returned hash keys are strings. See <tt>symbolized_path_parameters</tt> for symbolized keys.
0
- #
0
- # Example:
0
+ # Returns a hash with the \parameters used to form the \path of the request.
0
+ # Returned hash keys are strings:
0
     #
0
     # {'action' => 'my_action', 'controller' => 'my_controller'}
0
+ #
0
+ # See <tt>symbolized_path_parameters</tt> for symbolized keys.
0
     def path_parameters
0
       @path_parameters ||= {}
0
     end
...
148
149
150
151
 
152
153
154
...
148
149
150
 
151
152
153
154
0
@@ -148,7 +148,7 @@ module ActionController #:nodoc:
0
       end
0
 
0
       # Overwrite to implement public exception handling (for requests answering false to <tt>local_request?</tt>). By
0
- # default will call render_optional_error_file. Override this method to provide more user friendly error messages.s
0
+ # default will call render_optional_error_file. Override this method to provide more user friendly error messages.
0
       def rescue_action_in_public(exception) #:doc:
0
         render_optional_error_file response_code_for_rescue(exception)
0
       end
...
1
2
3
4
 
5
6
7
8
9
10
 
11
12
 
13
14
15
16
17
18
19
20
 
 
 
 
21
22
23
...
156
157
158
159
 
160
161
162
...
252
253
254
255
 
256
257
258
259
260
 
 
261
262
263
264
265
266
267
268
 
 
269
270
271
...
288
289
290
291
 
292
293
294
295
296
 
297
298
299
300
301
302
 
303
304
305
...
317
318
319
320
 
321
322
323
324
325
326
 
327
328
329
...
385
386
387
388
 
389
390
391
392
393
394
395
396
397
398
399
 
 
 
 
 
 
400
401
402
403
404
405
406
 
 
407
408
409
 
 
410
411
412
...
1
2
3
 
4
5
6
7
8
9
 
10
11
 
12
13
14
15
16
 
 
 
 
17
18
19
20
21
22
23
...
156
157
158
 
159
160
161
162
...
252
253
254
 
255
256
257
258
 
 
259
260
261
262
263
264
265
266
 
 
267
268
269
270
271
...
288
289
290
 
291
292
293
294
295
 
296
297
298
299
300
301
 
302
303
304
305
...
317
318
319
 
320
321
322
323
324
325
 
326
327
328
329
...
385
386
387
 
388
389
390
391
392
393
 
 
 
 
 
 
394
395
396
397
398
399
400
401
402
403
404
 
 
405
406
407
 
 
408
409
410
411
412
0
@@ -1,23 +1,23 @@
0
 module ActionController
0
   # == Overview
0
   #
0
- # ActionController::Resources are a way of defining RESTful resources. A RESTful resource, in basic terms,
0
+ # ActionController::Resources are a way of defining RESTful \resources. A RESTful \resource, in basic terms,
0
   # is something that can be pointed at and it will respond with a representation of the data requested.
0
   # In real terms this could mean a user with a browser requests an HTML page, or that a desktop application
0
   # requests XML data.
0
   #
0
   # RESTful design is based on the assumption that there are four generic verbs that a user of an
0
- # application can request from a resource (the noun).
0
+ # application can request from a \resource (the noun).
0
   #
0
- # Resources can be requested using four basic HTTP verbs (GET, POST, PUT, DELETE), the method used
0
+ # \Resources can be requested using four basic HTTP verbs (GET, POST, PUT, DELETE), the method used
0
   # denotes the type of action that should take place.
0
   #
0
   # === The Different Methods and their Usage
0
   #
0
- # [+GET+] Requests for a resource, no saving or editing of a resource should occur in a GET request
0
- # [+POST+] Creation of resources
0
- # [+PUT+] Editing of attributes on a resource
0
- # [+DELETE+] Deletion of a resource
0
+ # * GET - Requests for a \resource, no saving or editing of a \resource should occur in a GET request.
0
+ # * POST - Creation of \resources.
0
+ # * PUT - Editing of attributes on a \resource.
0
+ # * DELETE - Deletion of a \resource.
0
   #
0
   # === Examples
0
   #
0
@@ -156,7 +156,7 @@ module ActionController
0
     end
0
 
0
     # Creates named routes for implementing verb-oriented controllers
0
- # for a collection resource.
0
+ # for a collection \resource.
0
     #
0
     # For example:
0
     #
0
@@ -252,20 +252,20 @@ module ActionController
0
     # an array of any of the previous, or <tt>:any</tt> if the method does not matter.
0
     # These routes map to a URL like /messages/rss, with a route of +rss_messages_url+.
0
     # * <tt>:member</tt> - Same as <tt>:collection</tt>, but for actions that operate on a specific member.
0
- # * <tt>:new</tt> - Same as <tt>:collection</tt>, but for actions that operate on the new resource action.
0
+ # * <tt>:new</tt> - Same as <tt>:collection</tt>, but for actions that operate on the new \resource action.
0
     # * <tt>:controller</tt> - Specify the controller name for the routes.
0
     # * <tt>:singular</tt> - Specify the singular name used in the member routes.
0
     # * <tt>:requirements</tt> - Set custom routing parameter requirements.
0
- # * <tt>:conditions</tt> - Specify custom routing recognition conditions. Resources sets the <tt>:method</tt> value for the method-specific routes.
0
- # * <tt>:as</tt> - Specify a different resource name to use in the URL path. For example:
0
+ # * <tt>:conditions</tt> - Specify custom routing recognition conditions. \Resources sets the <tt>:method</tt> value for the method-specific routes.
0
+ # * <tt>:as</tt> - Specify a different \resource name to use in the URL path. For example:
0
     # # products_path == '/productos'
0
     # map.resources :products, :as => 'productos' do |product|
0
     # # product_reviews_path(product) == '/productos/1234/comentarios'
0
     # product.resources :product_reviews, :as => 'comentarios'
0
     # end
0
     #
0
- # * <tt>:has_one</tt> - Specify nested resources, this is a shorthand for mapping singleton resources beneath the current.
0
- # * <tt>:has_many</tt> - Same has <tt>:has_one</tt>, but for plural resources.
0
+ # * <tt>:has_one</tt> - Specify nested \resources, this is a shorthand for mapping singleton \resources beneath the current.
0
+ # * <tt>:has_many</tt> - Same has <tt>:has_one</tt>, but for plural \resources.
0
     #
0
     # You may directly specify the routing association with +has_one+ and +has_many+ like:
0
     #
0
@@ -288,18 +288,18 @@ module ActionController
0
     #
0
     # * <tt>:path_prefix</tt> - Set a prefix to the routes with required route variables.
0
     #
0
- # Weblog comments usually belong to a post, so you might use resources like:
0
+ # Weblog comments usually belong to a post, so you might use +resources+ like:
0
     #
0
     # map.resources :articles
0
     # map.resources :comments, :path_prefix => '/articles/:article_id'
0
     #
0
- # You can nest resources calls to set this automatically:
0
+ # You can nest +resources+ calls to set this automatically:
0
     #
0
     # map.resources :articles do |article|
0
     # article.resources :comments
0
     # end
0
     #
0
- # The comment resources work the same, but must now include a value for <tt>:article_id</tt>.
0
+ # The comment \resources work the same, but must now include a value for <tt>:article_id</tt>.
0
     #
0
     # article_comments_url(@article)
0
     # article_comment_url(@article, @comment)
0
@@ -317,13 +317,13 @@ module ActionController
0
     # map.resources :tags, :path_prefix => '/books/:book_id', :name_prefix => 'book_'
0
     # map.resources :tags, :path_prefix => '/toys/:toy_id', :name_prefix => 'toy_'
0
     #
0
- # You may also use <tt>:name_prefix</tt> to override the generic named routes in a nested resource:
0
+ # You may also use <tt>:name_prefix</tt> to override the generic named routes in a nested \resource:
0
     #
0
     # map.resources :articles do |article|
0
     # article.resources :comments, :name_prefix => nil
0
     # end
0
     #
0
- # This will yield named resources like so:
0
+ # This will yield named \resources like so:
0
     #
0
     # comments_url(@article)
0
     # comment_url(@article, @comment)
0
@@ -385,28 +385,28 @@ module ActionController
0
     #
0
     # The +resources+ method sets HTTP method restrictions on the routes it generates. For example, making an
0
     # HTTP POST on <tt>new_message_url</tt> will raise a RoutingError exception. The default route in
0
- # <tt>config/routes.rb</tt> overrides this and allows invalid HTTP methods for resource routes.
0
+ # <tt>config/routes.rb</tt> overrides this and allows invalid HTTP methods for \resource routes.
0
     def resources(*entities, &block)
0
       options = entities.extract_options!
0
       entities.each { |entity| map_resource(entity, options.dup, &block) }
0
     end
0
 
0
- # Creates named routes for implementing verb-oriented controllers for a singleton resource.
0
- # A singleton resource is global to its current context. For unnested singleton resources,
0
- # the resource is global to the current user visiting the application, such as a user's
0
- # /account profile. For nested singleton resources, the resource is global to its parent
0
- # resource, such as a <tt>projects</tt> resource that <tt>has_one :project_manager</tt>.
0
- # The <tt>project_manager</tt> should be mapped as a singleton resource under <tt>projects</tt>:
0
+ # Creates named routes for implementing verb-oriented controllers for a singleton \resource.
0
+ # A singleton \resource is global to its current context. For unnested singleton \resources,
0
+ # the \resource is global to the current user visiting the application, such as a user's
0
+ # <tt>/account</tt> profile. For nested singleton \resources, the \resource is global to its parent
0
+ # \resource, such as a <tt>projects</tt> \resource that <tt>has_one :project_manager</tt>.
0
+ # The <tt>project_manager</tt> should be mapped as a singleton \resource under <tt>projects</tt>:
0
     #
0
     # map.resources :projects do |project|
0
     # project.resource :project_manager
0
     # end
0
     #
0
- # See map.resources for general conventions. These are the main differences:
0
- # * A singular name is given to map.resource. The default controller name is still taken from the plural name.
0
+ # See +resources+ for general conventions. These are the main differences:
0
+ # * A singular name is given to <tt>map.resource</tt>. The default controller name is still taken from the plural name.
0
     # * To specify a custom plural name, use the <tt>:plural</tt> option. There is no <tt>:singular</tt> option.
0
- # * No default index route is created for the singleton resource controller.
0
- # * When nesting singleton resources, only the singular name is used as the path prefix (example: 'account/messages/1')
0
+ # * No default index route is created for the singleton \resource controller.
0
+ # * When nesting singleton \resources, only the singular name is used as the path prefix (example: 'account/messages/1')
0
     #
0
     # For example:
0
     #
...
155
156
157
158
 
159
160
161
 
162
163
164
...
155
156
157
 
158
159
160
 
161
162
163
164
0
@@ -155,10 +155,10 @@ module ActionView
0
       # Creates a file upload field. If you are using file uploads then you will also need
0
       # to set the multipart option for the form tag:
0
       #
0
- # <%= form_tag { :action => "post" }, { :multipart => true } %>
0
+ # <% form_tag '/upload', :multipart => true do %>
0
       # <label for="file">File to Upload</label> <%= file_field_tag "file" %>
0
       # <%= submit_tag %>
0
- # <%= end_form_tag %>
0
+ # <% end %>
0
       #
0
       # The specified URL will then be passed a File object containing the selected file, or if the field
0
       # was left blank, a StringIO object.
...
614
615
616
617
 
618
619
620
...
614
615
616
 
617
618
619
620
0
@@ -614,7 +614,7 @@ module ActionView
0
         # Example:
0
         #
0
         # # Generates:
0
- # # new Element.insert("list", { bottom: <li>Some item</li>" });
0
+ # # new Element.insert("list", { bottom: "<li>Some item</li>" });
0
         # # new Effect.Highlight("list");
0
         # # ["status-indicator", "cancel-link"].each(Element.hide);
0
         # update_page do |page|
...
507
508
509
510
 
511
512
513
...
507
508
509
 
510
511
512
513
0
@@ -507,7 +507,7 @@ module ActionView
0
       # @items = [1,2,3,4]
0
       # <% @items.each do |item| %>
0
       # <div style="background-color:<%= cycle("red","white","blue") %>">
0
- # <span style="background-color:<%= current_cycle %><%= item %></span>
0
+ # <span style="background-color:<%= current_cycle %>"><%= item %></span>
0
       # </div>
0
       # <% end %>
0
       def current_cycle(name = "default")
...
25
26
27
28
 
29
30
31
...
101
102
103
104
105
 
...
25
26
27
 
28
29
30
31
...
101
102
103
 
104
105
0
@@ -25,7 +25,7 @@ module ActiveModel
0
       # Configuration options:
0
       # * <tt>:message</tt> - Specifies a custom error message (default is: "has already been taken")
0
       # * <tt>:scope</tt> - One or more columns by which to limit the scope of the uniqueness constraint.
0
- # * <tt>:case_sensitive</tt> - Looks for an exact match. Ignored by non-text columns (+false+ by default).
0
+ # * <tt>:case_sensitive</tt> - Looks for an exact match. Ignored by non-text columns (+true+ by default).
0
       # * <tt>:allow_nil</tt> - If set to +true+, skips this validation if the attribute is +nil+ (default is: +false+)
0
       # * <tt>:allow_blank</tt> - If set to +true+, skips this validation if the attribute is blank (default is: +false+)
0
       # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
@@ -101,4 +101,4 @@ module ActiveModel
0
       end
0
     end
0
   end
0
-end
0
\ No newline at end of file
0
+end
...
660
661
662
663
664
 
 
665
666
667
...
1223
1224
1225
1226
1227
1228
1229
1230
1231
 
 
 
 
 
1232
1233
1234
...
660
661
662
 
 
663
664
665
666
667
...
1223
1224
1225
 
 
 
 
 
 
1226
1227
1228
1229
1230
1231
1232
1233
0
@@ -660,8 +660,8 @@ module ActiveRecord
0
       #
0
       # === Example
0
       #
0
- # A Firm class declares <tt>has_many :clients</tt>, which will add:
0
- # * <tt>Firm#clients</tt> (similar to <tt>Clients.find :all, :conditions => "firm_id = #{id}"</tt>)
0
+ # Example: A Firm class declares <tt>has_many :clients</tt>, which will add:
0
+ # * <tt>Firm#clients</tt> (similar to <tt>Clients.find :all, :conditions => ["firm_id = ?", id]</tt>)
0
       # * <tt>Firm#clients<<</tt>
0
       # * <tt>Firm#clients.delete</tt>
0
       # * <tt>Firm#clients=</tt>
0
@@ -1223,12 +1223,11 @@ module ActiveRecord
0
       end
0
 
0
       private
0
- # Generate a join table name from two provided tables names.
0
- # The order of names in join name is determined by lexical precedence.
0
- # join_table_name("members", "clubs")
0
- # => "clubs_members"
0
- # join_table_name("members", "special_clubs")
0
- # => "members_special_clubs"
0
+ # Generates a join table name from two provided table names.
0
+ # The names in the join table namesme end up in lexicographic order.
0
+ #
0
+ # join_table_name("members", "clubs") # => "clubs_members"
0
+ # join_table_name("members", "special_clubs") # => "members_special_clubs"
0
         def join_table_name(first_table_name, second_table_name)
0
           if first_table_name < second_table_name
0
             join_table = "#{first_table_name}_#{second_table_name}"
...
2
3
4
 
 
 
 
 
 
 
 
 
 
 
 
 
5
6
7
...
214
215
216
217
218
219
 
 
 
 
 
 
 
 
 
 
220
221
222
...
228
229
230
231
232
 
 
 
 
 
233
234
235
236
 
 
 
237
238
239
...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
227
228
229
 
 
 
230
231
232
233
234
235
236
237
238
239
240
241
242
...
248
249
250
 
 
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
0
@@ -2,6 +2,19 @@ require 'set'
0
 
0
 module ActiveRecord
0
   module Associations
0
+ # AssociationCollection is an abstract class that provides common stuff to
0
+ # ease the implementation of association proxies that represent
0
+ # collections. See the class hierarchy in AssociationProxy.
0
+ #
0
+ # You need to be careful with assumptions regarding the target: The proxy
0
+ # does not fetch records from the database until it needs them, but new
0
+ # ones created with +build+ are added to the target. So, the target may be
0
+ # non-empty and still lack children waiting to be read from the database.
0
+ # If you look directly to the database you cannot assume that's the entire
0
+ # collection because new records may have beed added to the target, etc.
0
+ #
0
+ # If you need to work on all current children, new and existing records,
0
+ # +load_target+ and the +loaded+ flag are your friends.
0
     class AssociationCollection < AssociationProxy #:nodoc:
0
       def initialize(owner, reflection)
0
         super
0
@@ -214,9 +227,16 @@ module ActiveRecord
0
         end
0
       end
0
 
0
- # Returns the size of the collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and
0
- # calling collection.size if it has. If it's more likely than not that the collection does have a size larger than zero
0
- # and you need to fetch that collection afterwards, it'll take one less SELECT query if you use length.