public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/johngibbs/rails.git
Merge docrails:

commit e6afd8b2736364322b673bbdcca3e9b38b6d3da0
Author: Xavier Noria <fxn@hashref.com>
Date:   Thu May 8 23:49:36 2008 +0200

    Overall documentation improvement and markup corrections. Zillion 
    changes.

commit 2fead68b3192332eee27945ed95a94a64ca73f70
Author: Austin Putman <austin@emmanuel.local>
Date:   Wed May 7 19:35:46 2008 -0700

    Documented class methods on ActionController::Routing.  These are 
    dangerous, and mostly used for testing.

commit f5b84182dbc39bea79c8ee319c688d00fa99f9d1
Author: Teflon Ted <github@rudiment.net>
Date:   Wed May 7 16:08:49 2008 -0400

    Added explanation about errant inflections not being patched in the 
    future in order to avoid breaking legacy applications.

commit 370f4f51722cec49ace17093d29e9ce9e8f15cfb
Author: Sunny Ripert <negatif@gmail.com>
Date:   Wed May 7 14:00:59 2008 +0200

    Applied list conventions in AR::Base

commit 5bd18429f09d44e75191bec42a6db04bd33f3030
Author: Sunny Ripert <negatif@gmail.com>
Date:   Wed May 7 13:53:35 2008 +0200

    Renamed Options list to Attributes list whenever they weren't option 
    hashes in AR::Base

commit d912bd5672316454457ae83f6e9dda5197beeb6f
Author: Yaroslav Markin <yaroslav@markin.net>
Date:   Wed May 7 13:50:28 2008 +0400

    Add a filter_parameter_logging usage hint to generated 
    ApplicationController.
    This may help to remind the developer to filter sensitive information 
    from application logs.
    Closes #11578

commit b243de0db3c2605121e055079854af5090d06374
Author: Jack Danger Canty <git@6brand.com>
Date:   Tue May 6 23:39:47 2008 -0700

    doc: disambiguating an example ActiveRecord class

commit f81d771f0657ae8375b84a77a059812cce5d6fd9
Author: Jack Danger Canty <git@6brand.com>
Date:   Tue May 6 23:35:05 2008 -0700

    doc: 
    ActiveRecord::Reflection::AssociationReflection#through_reflection

    Added documentation demonstrating the use of #through_reflection for
    finding intervening reflection objects for HasManyThrough
    and HasOneThrough.

commit ae6b46f00b5b8b2939c6b37ce3329c83de7e71db
Author: Cheah Chu Yeow <chuyeow@gmail.com>
Date:   Wed May 7 13:47:41 2008 +0800

    Document AttributeAssignmentError and MultiparameterAssignmentErrors.

commit 8f463550b597db2156b67733f31aed13487fbc3a
Author: John Barnette <jbarnette@gmail.com>
Date:   Tue May 6 22:46:44 2008 -0700

    Killing/fixing a bunch of outdated language in the AR README.

commit aca44bcd92ef783abdf484b58abdde6786db0f89
Author: Cheah Chu Yeow <chuyeow@gmail.com>
Date:   Wed May 7 13:34:52 2008 +0800

    Make a note about ActiveResource::Timeouterror being raised when ARes 
    calls timeout.

commit 284a930a93fbee16e25d06392779dbf2f03e9e12
Author: Jonathan Dance <jd@wuputah.com>
Date:   Tue May 6 14:58:26 2008 -0400

    improvements to the page caching docs

commit 9482da621390c874da7c921c8bd6230caae7035a
Author: Sunny Ripert <negatif@gmail.com>
Date:   Mon May 5 18:13:40 2008 +0200

    validates_numericality_of() "integer" option really is "only_integer"

commit e9afd6790a8f530528f6597a7f59bb283be754f6
Author: Sunny Ripert <negatif@gmail.com>
Date:   Mon May 5 12:11:59 2008 +0200

    Harmonized hash notation in AR::Base

commit 67ebf14a91ffd970b582be4ff2991d691a9cf3e1
Author: Sunny Ripert <negatif@gmail.com>
Date:   Mon May 5 12:06:19 2008 +0200

    Turned options into rdoc-lists in AR::Base

commit 0ec7c0a41d889d4e5382b9dff72f1aaba89bf297
Author: Marshall Huss <mwhuss@Macbook.local>
Date:   Sun May 4 23:21:33 2008 -0400

    Added information of how to set element_name in the case the user has 
    a name confliction with an existing model

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
lifo (author)
Fri May 09 02:38:02 -0700 2008
commit  dc4eec1129520ce9863c9373d7cb79d8636ab7ca
tree    c7548000db7be1adb3b12ec5e6d3877d9262f979
parent  bfbf03ecee063adc9999c0dec50f8177594fb28f
...
95
96
97
98
 
99
100
101
...
204
205
206
207
208
209
210
211
212
 
 
 
 
 
 
213
214
215
216
217
218
 
 
 
 
219
220
221
222
 
223
224
225
...
406
407
408
409
 
410
411
412
...
95
96
97
 
98
99
100
101
...
204
205
206
 
 
 
 
 
 
207
208
209
210
211
212
213
214
215
 
 
 
216
217
218
219
220
221
222
 
223
224
225
226
...
407
408
409
 
410
411
412
413
0
@@ -95,7 +95,7 @@ module ActionMailer #:nodoc:
0
   #
0
   # ActionMailer::Base.default_url_options[:host] = "example.com"
0
   #
0
- # This can also be set as a configuration option in <tt>environment.rb</tt>:
0
+ # This can also be set as a configuration option in <tt>config/environment.rb</tt>:
0
   #
0
   # config.action_mailer.default_url_options = { :host => "example.com" }
0
   #
0
@@ -204,22 +204,23 @@ module ActionMailer #:nodoc:
0
   # Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.
0
   #
0
   # * <tt>smtp_settings</tt> - Allows detailed configuration for <tt>:smtp</tt> delivery method:
0
- # * <tt>:address</tt> Allows you to use a remote mail server. Just change it from its default "localhost" setting.
0
- # * <tt>:port</tt> On the off chance that your mail server doesn't run on port 25, you can change it.
0
- # * <tt>:domain</tt> If you need to specify a HELO domain, you can do it here.
0
- # * <tt>:user_name</tt> If your mail server requires authentication, set the username in this setting.
0
- # * <tt>:password</tt> If your mail server requires authentication, set the password in this setting.
0
- # * <tt>:authentication</tt> If your mail server requires authentication, you need to specify the authentication type here.
0
+ # * <tt>:address</tt> - Allows you to use a remote mail server. Just change it from its default "localhost" setting.
0
+ # * <tt>:port</tt> - On the off chance that your mail server doesn't run on port 25, you can change it.
0
+ # * <tt>:domain</tt> - If you need to specify a HELO domain, you can do it here.
0
+ # * <tt>:user_name</tt> - If your mail server requires authentication, set the username in this setting.
0
+ # * <tt>:password</tt> - If your mail server requires authentication, set the password in this setting.
0
+ # * <tt>:authentication</tt> - If your mail server requires authentication, you need to specify the authentication type here.
0
   # This is a symbol and one of <tt>:plain</tt>, <tt>:login</tt>, <tt>:cram_md5</tt>
0
   #
0
   # * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method
0
- # * <tt>:location</tt> The location of the sendmail executable, defaults to "/usr/sbin/sendmail"
0
- # * <tt>:arguments</tt> The command line arguments
0
- # * <tt>raise_delivery_errors</tt> - whether or not errors should be raised if the email fails to be delivered.
0
+ # * <tt>:location</tt> - The location of the sendmail executable, defaults to "/usr/sbin/sendmail"
0
+ # * <tt>:arguments</tt> - The command line arguments
0
+ #
0
+ # * <tt>raise_delivery_errors</tt> - Whether or not errors should be raised if the email fails to be delivered.
0
   #
0
   # * <tt>delivery_method</tt> - Defines a delivery method. Possible values are <tt>:smtp</tt> (default), <tt>:sendmail</tt>, and <tt>:test</tt>.
0
   #
0
- # * <tt>perform_deliveries</tt> - Determines whether deliver_* methods are actually carried out. By default they are,
0
+ # * <tt>perform_deliveries</tt> - Determines whether <tt>deliver_*</tt> methods are actually carried out. By default they are,
0
   # but this can be turned off to help functional testing.
0
   #
0
   # * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with <tt>delivery_method :test</tt>. Most useful
0
@@ -406,7 +407,7 @@ module ActionMailer #:nodoc:
0
       # templating language other than rhtml or rxml are supported.
0
       # To use this, include in your template-language plugin's init
0
       # code or on a per-application basis, this can be invoked from
0
- # config/environment.rb:
0
+ # <tt>config/environment.rb</tt>:
0
       #
0
       # ActionMailer::Base.register_template_extension('haml')
0
       def register_template_extension(extension)
...
21
22
23
24
 
25
26
 
27
28
 
29
30
31
...
136
137
138
139
140
141
 
 
 
142
143
 
144
145
 
146
147
148
149
150
151
 
152
153
 
154
155
 
156
157
 
158
159
 
160
161
162
...
21
22
23
 
24
25
 
26
27
 
28
29
30
31
...
136
137
138
 
 
 
139
140
141
142
 
143
144
 
145
146
147
148
149
150
 
151
152
 
153
154
 
155
156
 
157
158
 
159
160
161
162
0
@@ -21,11 +21,11 @@ module ActionController
0
     # from the response HTML or elements selected by the enclosing assertion.
0
     #
0
     # In addition to HTML responses, you can make the following assertions:
0
- # * #assert_select_rjs -- Assertions on HTML content of RJS update and
0
+ # * +assert_select_rjs+ - Assertions on HTML content of RJS update and
0
     # insertion operations.
0
- # * #assert_select_encoded -- Assertions on HTML encoded inside XML,
0
+ # * +assert_select_encoded+ - Assertions on HTML encoded inside XML,
0
     # for example for dealing with feed item descriptions.
0
- # * #assert_select_email -- Assertions on the HTML body of an e-mail.
0
+ # * +assert_select_email+ - Assertions on the HTML body of an e-mail.
0
     #
0
     # Also see HTML::Selector to learn how to use selectors.
0
     module SelectorAssertions
0
@@ -136,27 +136,27 @@ module ActionController
0
       # === Equality Tests
0
       #
0
       # The equality test may be one of the following:
0
- # * <tt>true</tt> -- Assertion is true if at least one element selected.
0
- # * <tt>false</tt> -- Assertion is true if no element selected.
0
- # * <tt>String/Regexp</tt> -- Assertion is true if the text value of at least
0
+ # * <tt>true</tt> - Assertion is true if at least one element selected.
0
+ # * <tt>false</tt> - Assertion is true if no element selected.
0
+ # * <tt>String/Regexp</tt> - Assertion is true if the text value of at least
0
       # one element matches the string or regular expression.
0
- # * <tt>Integer</tt> -- Assertion is true if exactly that number of
0
+ # * <tt>Integer</tt> - Assertion is true if exactly that number of
0
       # elements are selected.
0
- # * <tt>Range</tt> -- Assertion is true if the number of selected
0
+ # * <tt>Range</tt> - Assertion is true if the number of selected
0
       # elements fit the range.
0
       # If no equality test specified, the assertion is true if at least one
0
       # element selected.
0
       #
0
       # To perform more than one equality tests, use a hash with the following keys:
0
- # * <tt>:text</tt> -- Narrow the selection to elements that have this text
0
+ # * <tt>:text</tt> - Narrow the selection to elements that have this text
0
       # value (string or regexp).
0
- # * <tt>:html</tt> -- Narrow the selection to elements that have this HTML
0
+ # * <tt>:html</tt> - Narrow the selection to elements that have this HTML
0
       # content (string or regexp).
0
- # * <tt>:count</tt> -- Assertion is true if the number of selected elements
0
+ # * <tt>:count</tt> - Assertion is true if the number of selected elements
0
       # is equal to this value.
0
- # * <tt>:minimum</tt> -- Assertion is true if the number of selected
0
+ # * <tt>:minimum</tt> - Assertion is true if the number of selected
0
       # elements is at least this value.
0
- # * <tt>:maximum</tt> -- Assertion is true if the number of selected
0
+ # * <tt>:maximum</tt> - Assertion is true if the number of selected
0
       # elements is at most this value.
0
       #
0
       # If the method is called with a block, once all equality tests are
...
159
160
161
162
163
 
164
165
166
 
 
167
168
 
 
 
 
 
 
169
170
171
172
173
 
 
174
175
 
176
177
 
178
179
 
 
180
181
 
182
183
 
 
184
185
186
...
535
536
537
538
539
 
 
540
541
542
543
 
 
544
545
546
547
548
549
550
551
 
 
 
 
 
 
 
552
553
554
...
159
160
161
 
 
162
163
 
 
164
165
166
 
167
168
169
170
171
172
173
174
175
 
 
176
177
178
 
179
180
 
181
182
 
183
184
185
 
186
187
 
188
189
190
191
192
...
541
542
543
 
 
544
545
546
547
 
 
548
549
550
 
 
 
 
 
 
 
551
552
553
554
555
556
557
558
559
560
0
@@ -159,28 +159,34 @@ module ActionController #:nodoc:
0
   #
0
   # Hello #{session[:person]}
0
   #
0
- # For removing objects from the session, you can either assign a single key to nil, like <tt>session[:person] = nil</tt>, or you can
0
- # remove the entire session with reset_session.
0
+ # For removing objects from the session, you can either assign a single key to +nil+:
0
   #
0
- # Sessions are stored in a browser cookie that's cryptographically signed, but unencrypted, by default. This prevents
0
- # the user from tampering with the session but also allows him to see its contents.
0
+ # # removes :person from session
0
+ # session[:person] = nil
0
   #
0
- # Do not put secret information in session!
0
+ # or you can remove the entire session with +reset_session+.
0
+ #
0
+ # Sessions are stored by default in a browser cookie that's cryptographically signed, but unencrypted.
0
+ # This prevents the user from tampering with the session but also allows him to see its contents.
0
+ #
0
+ # Do not put secret information in cookie-based sessions!
0
   #
0
   # Other options for session storage are:
0
   #
0
- # ActiveRecordStore: sessions are stored in your database, which works better than PStore with multiple app servers and,
0
- # unlike CookieStore, hides your session contents from the user. To use ActiveRecordStore, set
0
+ # * ActiveRecordStore - Sessions are stored in your database, which works better than PStore with multiple app servers and,
0
+ # unlike CookieStore, hides your session contents from the user. To use ActiveRecordStore, set
0
   #
0
- # config.action_controller.session_store = :active_record_store
0
+ # config.action_controller.session_store = :active_record_store
0
   #
0
- # in your <tt>environment.rb</tt> and run <tt>rake db:sessions:create</tt>.
0
+ # in your <tt>config/environment.rb</tt> and run <tt>rake db:sessions:create</tt>.
0
   #
0
- # MemCacheStore: sessions are stored as entries in your memcached cache. Set the session store type in <tt>environment.rb</tt>:
0
+ # * MemCacheStore - Sessions are stored as entries in your memcached cache.
0
+ # Set the session store type in <tt>config/environment.rb</tt>:
0
   #
0
- # config.action_controller.session_store = :mem_cache_store
0
+ # config.action_controller.session_store = :mem_cache_store
0
   #
0
- # This assumes that memcached has been installed and configured properly. See the MemCacheStore docs for more information.
0
+ # This assumes that memcached has been installed and configured properly.
0
+ # See the MemCacheStore docs for more information.
0
   #
0
   # == Responses
0
   #
0
@@ -535,20 +541,20 @@ module ActionController #:nodoc:
0
       #
0
       # <tt>url_for</tt> is used to:
0
       #
0
- # All keys given to url_for are forwarded to the Route module, save for the following:
0
- # * <tt>:anchor</tt> -- specifies the anchor name to be appended to the path. For example,
0
+ # All keys given to +url_for+ are forwarded to the Route module, save for the following:
0
+ # * <tt>:anchor</tt> - Specifies the anchor name to be appended to the path. For example,
0
       # <tt>url_for :controller => 'posts', :action => 'show', :id => 10, :anchor => 'comments'</tt>
0
       # will produce "/posts/show/10#comments".
0
- # * <tt>:only_path</tt> -- if true, returns the relative URL (omitting the protocol, host name, and port) (<tt>false</tt> by default)
0
- # * <tt>:trailing_slash</tt> -- if true, adds a trailing slash, as in "/archive/2005/". Note that this
0
+ # * <tt>:only_path</tt> - If true, returns the relative URL (omitting the protocol, host name, and port) (<tt>false</tt> by default).
0
+ # * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in "/archive/2005/". Note that this
0
       # is currently not recommended since it breaks caching.
0
- # * <tt>:host</tt> -- overrides the default (current) host if provided.
0
- # * <tt>:protocol</tt> -- overrides the default (current) protocol if provided.
0
- # * <tt>:port</tt> -- optionally specify the port to connect to.
0
- # * <tt>:user</tt> -- Inline HTTP authentication (only plucked out if <tt>:password</tt> is also present).
0
- # * <tt>:password</tt> -- Inline HTTP authentication (only plucked out if <tt>:user</tt> is also present).
0
- # * <tt>:skip_relative_url_root</tt> -- if true, the url is not constructed using the relative_url_root of the request so the path
0
- # will include the web server relative installation directory.
0
+ # * <tt>:host</tt> - Overrides the default (current) host if provided.
0
+ # * <tt>:protocol</tt> - Overrides the default (current) protocol if provided.
0
+ # * <tt>:port</tt> - Optionally specify the port to connect to.
0
+ # * <tt>:user</tt> - Inline HTTP authentication (only plucked out if <tt>:password</tt> is also present).
0
+ # * <tt>:password</tt> - Inline HTTP authentication (only plucked out if <tt>:user</tt> is also present).
0
+ # * <tt>:skip_relative_url_root</tt> - If true, the url is not constructed using the +relative_url_root+
0
+ # of the request so the path will include the web server relative installation directory.
0
       #
0
       # The URL is generated from the remaining keys in the hash. A URL contains two key parts: the <base> and a query string.
0
       # Routes composes a query string as the key/value pairs not included in the <base>.
...
20
21
22
23
 
 
24
25
26
...
20
21
22
 
23
24
25
26
27
0
@@ -20,7 +20,8 @@ module ActionController #:nodoc:
0
   #
0
   # == Caching stores
0
   #
0
- # All the caching stores from ActiveSupport::Cache is available to be used as backends for Action Controller caching.
0
+ # All the caching stores from ActiveSupport::Cache is available to be used as backends for Action Controller caching. This setting only
0
+ # affects action and fragment caching as page caching is always written to disk.
0
   #
0
   # Configuration examples (MemoryStore is the default):
0
   #
...
4
5
6
7
8
9
10
 
 
 
 
 
11
12
 
13
14
15
16
17
18
19
20
 
 
 
21
22
23
 
24
25
26
...
35
36
37
38
39
 
 
 
 
40
41
42
43
44
 
 
 
 
45
46
47
...
4
5
6
 
 
 
 
7
8
9
10
11
12
 
13
14
15
16
17
18
 
 
 
19
20
21
22
23
 
24
25
26
27
...
36
37
38
 
 
39
40
41
42
43
44
45
 
 
46
47
48
49
50
51
52
0
@@ -4,23 +4,24 @@ require 'uri'
0
 module ActionController #:nodoc:
0
   module Caching
0
     # Page caching is an approach to caching where the entire action output of is stored as a HTML file that the web server
0
- # can serve without going through the Action Pack. This can be as much as 100 times faster than going through the process of dynamically
0
- # generating the content. Unfortunately, this incredible speed-up is only available to stateless pages where all visitors
0
- # are treated the same. Content management systems -- including weblogs and wikis -- have many pages that are a great fit
0
- # for this approach, but account-based systems where people log in and manipulate their own data are often less likely candidates.
0
+ # can serve without going through Action Pack. This is the fastest way to cache your content as opposed to going dynamically
0
+ # through the process of generating the content. Unfortunately, this incredible speed-up is only available to stateless pages
0
+ # where all visitors are treated the same. Content management systems -- including weblogs and wikis -- have many pages that are
0
+ # a great fit for this approach, but account-based systems where people log in and manipulate their own data are often less
0
+ # likely candidates.
0
     #
0
- # Specifying which actions to cache is done through the <tt>caches</tt> class method:
0
+ # Specifying which actions to cache is done through the <tt>caches_page</tt> class method:
0
     #
0
     # class WeblogController < ActionController::Base
0
     # caches_page :show, :new
0
     # end
0
     #
0
- # This will generate cache files such as weblog/show/5 and weblog/new, which match the URLs used to trigger the dynamic
0
- # generation. This is how the web server is able pick up a cache file when it exists and otherwise let the request pass on to
0
- # the Action Pack to generate it.
0
+ # This will generate cache files such as <tt>weblog/show/5.html</tt> and <tt>weblog/new.html</tt>,
0
+ # which match the URLs used to trigger the dynamic generation. This is how the web server is able
0
+ # pick up a cache file when it exists and otherwise let the request pass on to Action Pack to generate it.
0
     #
0
     # Expiration of the cache is handled by deleting the cached file, which results in a lazy regeneration approach where the cache
0
- # is not restored before another hit is made against it. The API for doing so mimics the options from url_for and friends:
0
+ # is not restored before another hit is made against it. The API for doing so mimics the options from +url_for+ and friends:
0
     #
0
     # class WeblogController < ActionController::Base
0
     # def update
0
@@ -35,13 +36,17 @@ module ActionController #:nodoc:
0
     #
0
     # == Setting the cache directory
0
     #
0
- # The cache directory should be the document root for the web server and is set using Base.page_cache_directory = "/document/root".
0
- # For Rails, this directory has already been set to Rails.public_path (which is usually set to RAILS_ROOT + "/public").
0
+ # The cache directory should be the document root for the web server and is set using <tt>Base.page_cache_directory = "/document/root"</tt>.
0
+ # For Rails, this directory has already been set to Rails.public_path (which is usually set to <tt>RAILS_ROOT + "/public"</tt>). Changing
0
+ # this setting can be useful to avoid naming conflicts with files in <tt>public/</tt>, but doing so will likely require configuring your
0
+ # web server to look in the new location for cached files.
0
     #
0
     # == Setting the cache extension
0
     #
0
- # By default, the cache extension is .html, which makes it easy for the cached files to be picked up by the web server. If you want
0
- # something else, like .php or .shtml, just set Base.page_cache_extension.
0
+ # Most Rails requests do not have an extension, such as <tt>/weblog/new</tt>. In these cases, the page caching mechanism will add one in
0
+ # order to make it easy for the cached files to be picked up properly by the web server. By default, this cache extension is <tt>.html</tt>.
0
+ # If you want something else, like <tt>.php</tt> or <tt>.shtml</tt>, just set Base.page_cache_extension. In cases where a request already has an
0
+ # extension, such as <tt>.xml</tt> or <tt>.rss</tt>, page caching will not add an extension. This allows it to work well with RESTful apps.
0
     module Pages
0
       def self.included(base) #:nodoc:
0
         base.extend(ClassMethods)
...
47
48
49
50
51
 
 
52
53
54
55
56
 
 
 
 
 
57
58
59
60
61
 
62
63
64
 
65
66
67
68
 
69
70
71
...
47
48
49
 
 
50
51
52
53
 
 
 
54
55
56
57
58
59
60
61
62
 
63
64
65
 
66
67
68
69
 
70
71
72
73
0
@@ -47,25 +47,27 @@ module ActionController
0
     # Constructs a call to a named RESTful route for the given record and returns the
0
     # resulting URL string. For example:
0
     #
0
- # polymorphic_url(post)
0
- # # calls post_url(post) #=> "http://example.com/posts/1"
0
+ # # calls post_url(post)
0
+ # polymorphic_url(post) # => "http://example.com/posts/1"
0
     #
0
     # ==== Options
0
- # * <tt>:action</tt> -- specifies the action prefix for the named route:
0
- # <tt>:new</tt>, <tt>:edit</tt> or <tt>:formatted</tt>. Default is no prefix.
0
- # * <tt>:routing_type</tt> -- <tt>:path</tt> or <tt>:url</tt> (default <tt>:url</tt>).
0
+ #
0
+ # * <tt>:action</tt> - Specifies the action prefix for the named route:
0
+ # <tt>:new</tt>, <tt>:edit</tt>, or <tt>:formatted</tt>. Default is no prefix.
0
+ # * <tt>:routing_type</tt> - Allowed values are <tt>:path</tt> or <tt>:url</tt>.
0
+ # Default is <tt>:url</tt>.
0
     #
0
     # ==== Examples
0
     #
0
     # # an Article record
0
- # polymorphic_url(record) #-> article_url(record)
0
+ # polymorphic_url(record) # same as article_url(record)
0
     #
0
     # # a Comment record
0
- # polymorphic_url(record) #-> comment_url(record)
0
+ # polymorphic_url(record) # same as comment_url(record)
0
     #
0
     # # it recognizes new records and maps to the collection
0
     # record = Comment.new
0
- # polymorphic_url(record) #-> comments_url()
0
+ # polymorphic_url(record) # same as comments_url()
0
     #
0
     def polymorphic_url(record_or_hash_or_array, options = {})
0
       if record_or_hash_or_array.kind_of?(Array)
...
69
70
71
72
 
73
74
75
 
76
77
78
...
69
70
71
 
72
73
74
 
75
76
77
78
0
@@ -69,10 +69,10 @@ module ActionController #:nodoc:
0
       #
0
       # Valid Options:
0
       #
0
- # * <tt>:only/:except</tt> - passed to the <tt>before_filter</tt> call. Set which actions are verified.
0
+ # * <tt>:only/:except</tt> - Passed to the <tt>before_filter</tt> call. Set which actions are verified.
0
       # * <tt>:secret</tt> - Custom salt used to generate the <tt>form_authenticity_token</tt>.
0
       # Leave this off if you are using the cookie session store.
0
- # * <tt>:digest</tt> - Message digest used for hashing. Defaults to 'SHA1'
0
+ # * <tt>:digest</tt> - Message digest used for hashing. Defaults to 'SHA1'.
0
       def protect_from_forgery(options = {})
0
         self.request_forgery_protection_token ||= :authenticity_token
0
         before_filter :verify_authenticity_token, :only => options.delete(:only), :except => options.delete(:except)
...
236
237
238
239
240
 
 
241
242
243
244
245
246
247
248
249
 
 
 
 
 
 
 
 
250
251
252
253
254
255
256
257
 
 
258
259
 
260
261
262
...
268
269
270
271
 
272
273
274
275
276
277
278
 
279
280
281
...
296
297
298
299
 
300
301
302
...
343
344
345
346
 
347
348
349
...
236
237
238
 
 
239
240
241
 
 
 
 
 
 
 
 
242
243
244
245
246
247
248
249
250
251
252
253
254
255
 
 
256
257
258
 
259
260
261
262
...
268
269
270
 
271
272
273
274
275
276
277
 
278
279
280
281
...
296
297
298
 
299
300
301
302
...
343
344
345
 
346
347
348
349
0
@@ -236,27 +236,27 @@ module ActionController
0
     # which takes into account whether <tt>@message</tt> is a new record or not and generates the
0
     # path and method accordingly.
0
     #
0
- # The #resources method accepts the following options to customize the resulting routes:
0
- # * <tt>:collection</tt> - add named routes for other actions that operate on the collection.
0
+ # The +resources+ method accepts the following options to customize the resulting routes:
0
+ # * <tt>:collection</tt> - Add named routes for other actions that operate on the collection.
0
     # Takes a hash of <tt>#{action} => #{method}</tt>, where method is <tt>:get</tt>/<tt>:post</tt>/<tt>:put</tt>/<tt>:delete</tt>
0
- # or <tt>:any</tt> if the method does not matter. 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>: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
+ # or <tt>:any</tt> if the method does not matter. 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>: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
     # # 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
+ # You may directly specify the routing association with +has_one+ and +has_many+ like:
0
     #
0
     # map.resources :notes, :has_one => :author, :has_many => [:comments, :attachments]
0
     #
0
@@ -268,14 +268,14 @@ module ActionController
0
     # notes.resources :attachments
0
     # end
0
     #
0
- # * <tt>:path_names</tt> - specify different names for the 'new' and 'edit' actions. For example:
0
+ # * <tt>:path_names</tt> - Specify different names for the 'new' and 'edit' actions. For example:
0
     # # new_products_path == '/productos/nuevo'
0
     # map.resources :products, :as => 'productos', :path_names => { :new => 'nuevo', :edit => 'editar' }
0
     #
0
     # You can also set default action names from an environment, like this:
0
     # config.action_controller.resources_path_names = { :new => 'nuevo', :edit => 'editar' }
0
     #
0
- # * <tt>:path_prefix</tt> - set a prefix to the routes with required route variables.
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
     #
0
@@ -296,7 +296,7 @@ module ActionController
0
     # article_comments_url(:article_id => @article)
0
     # article_comment_url(:article_id => @article, :id => @comment)
0
     #
0
- # * <tt>:name_prefix</tt> - define a prefix for all generated routes, usually ending in an underscore.
0
+ # * <tt>:name_prefix</tt> - Define a prefix for all generated routes, usually ending in an underscore.
0
     # Use this if you have named routes that may clash.
0
     #
0
     # map.resources :tags, :path_prefix => '/books/:book_id', :name_prefix => 'book_'
0
@@ -343,7 +343,7 @@ module ActionController
0
     # # --> GET /categories/7/messages/1
0
     # # has named route "category_message"
0
     #
0
- # The #resources method sets HTTP method restrictions on the routes it generates. For example, making an
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
     def resources(*entities, &block)
...
15
16
17
18
 
19
20
21
...
53
54
55
56
 
57
58
59
...
118
119
120
121
 
122
123
124
...
217
218
219
220
 
221
222
223
...
277
278
279
 
 
 
280
281
282
...
285
286
287
 
 
 
 
288
289
290
...
303
304
305
 
306
307
308
...
327
328
329
 
 
330
331
332
333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
335
336
...
344
345
346
 
347
348
349
...
15
16
17
 
18
19
20
21
...
53
54
55
 
56
57
58
59
...
118
119
120
 
121
122
123
124
...
217
218
219
 
220
221
222
223
...
277
278
279
280
281
282
283
284
285
...
288
289
290
291
292
293
294
295
296
297
...
310
311
312
313
314
315
316
...
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
...
370
371
372
373
374
375
376
0
@@ -15,7 +15,7 @@ module ActionController
0
   # The routing module provides URL rewriting in native Ruby. It's a way to
0
   # redirect incoming requests to controllers and actions. This replaces
0
   # mod_rewrite rules. Best of all, Rails' Routing works with any web server.
0
- # Routes are defined in routes.rb in your RAILS_ROOT/config directory.
0
+ # Routes are defined in <tt>config/routes.rb</tt>.
0
   #
0
   # Consider the following route, installed by Rails when you generate your
0
   # application:
0
@@ -53,7 +53,7 @@ module ActionController
0
   # == Route priority
0
   #
0
   # Not all routes are created equally. Routes have priority defined by the
0
- # order of appearance of the routes in the routes.rb file. The priority goes
0
+ # order of appearance of the routes in the <tt>config/routes.rb</tt> file. The priority goes
0
   # from top to bottom. The last route in that file is at the lowest priority
0
   # and will be applied last. If no route matches, 404 is returned.
0
   #
0
@@ -118,7 +118,7 @@ module ActionController
0
   # root_url # => 'http://www.example.com/'
0
   # root_path # => ''
0
   #
0
- # You can also specify an already-defined named route in your map.root call:
0
+ # You can also specify an already-defined named route in your <tt>map.root</tt> call:
0
   #
0
   # # In routes.rb
0
   # map.new_session :controller => 'sessions', :action => 'new'
0
@@ -217,7 +217,7 @@ module ActionController
0
   # ActionController::Routing::Routes.reload
0
   #
0
   # This will clear all named routes and reload routes.rb if the file has been modified from
0
- # last load. To absolutely force reloading, use +reload!+.
0
+ # last load. To absolutely force reloading, use <tt>reload!</tt>.
0
   #
0
   # == Testing Routes
0
   #
0
@@ -277,6 +277,9 @@ module ActionController
0
     end
0
 
0
     class << self
0
+ # Expects an array of controller names as the first argument.
0
+ # Executes the passed block with only the named controllers named available.
0
+ # This method is used in internal Rails testing.
0
       def with_controllers(names)
0
         prior_controllers = @possible_controllers
0
         use_controllers! names
0
@@ -285,6 +288,10 @@ module ActionController
0
         use_controllers! prior_controllers
0
       end
0