public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/ddollar/rails.git
Fixed docs (closes #2468)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2749 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
dhh (author)
Wed Oct 26 06:20:46 -0700 2005
commit  82f1e19e4c493920e692309d15f66677ac8063e5
tree    f6d4808b55e22adfadb2bdb27ea3325f71b5cb18
parent  0b92d38c0083c2077d0533014678ed017026fac1
...
8
9
10
11
 
12
13
 
14
15
16
...
25
26
27
28
 
29
30
31
32
33
34
 
 
35
36
37
...
68
69
70
71
 
72
73
74
...
118
119
120
121
 
122
123
124
...
159
160
161
162
163
 
 
164
165
166
...
8
9
10
 
11
12
 
13
14
15
16
...
25
26
27
 
28
29
30
31
32
 
 
33
34
35
36
37
...
68
69
70
 
71
72
73
74
...
118
119
120
 
121
122
123
124
...
159
160
161
 
 
162
163
164
165
166
0
@@ -8,9 +8,9 @@ module Test #:nodoc:
0
     # In addition to these specific assertions, you also have easy access to various collections that the regular test/unit assertions
0
     # can be used against. These collections are:
0
     #
0
- # * assigns: Instance variables assigned in the action that's available for the view.
0
+ # * assigns: Instance variables assigned in the action that are available for the view.
0
     # * session: Objects being saved in the session.
0
- # * flash: The flash objects being currently in the session.
0
+ # * flash: The flash objects currently in the session.
0
     # * cookies: Cookies being sent to the user on this request.
0
     #
0
     # These collections can be used just like any other hash:
0
@@ -25,13 +25,13 @@ module Test #:nodoc:
0
     #
0
     # On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url.
0
     #
0
- # For redirects within the same controller, you can even call follow_redirect and the redirect will be follow triggering another
0
+ # For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another
0
     # action call which can then be asserted against.
0
     #
0
     # == Manipulating the request collections
0
     #
0
- # The collections described above link to the response, so you can test if what the actions were expected to do happen. But
0
- # some times you also want to manipulate these collections in the request coming in. This is really only relevant for sessions
0
+ # The collections described above link to the response, so you can test if what the actions were expected to do happened. But
0
+ # sometimes you also want to manipulate these collections in the incoming request. This is really only relevant for sessions
0
     # and cookies, though. For sessions, you just do:
0
     #
0
     # @request.session[:key] = "value"
0
@@ -68,7 +68,7 @@ module Test #:nodoc:
0
       end
0
 
0
       # Assert that the redirection options passed in match those of the redirect called in the latest action. This match can be partial,
0
- # such at assert_redirected_to(:controller => "weblog") will also match the redirection of
0
+ # such that assert_redirected_to(:controller => "weblog") will also match the redirection of
0
       # redirect_to(:controller => "weblog", :action => "show") and so on.
0
       def assert_redirected_to(options = {}, message=nil)
0
         clean_backtrace do
0
@@ -118,7 +118,7 @@ module Test #:nodoc:
0
         end
0
       end
0
 
0
- # Asserts that the routing of the given path is handled correctly and that the parsed options match.
0
+ # Asserts that the routing of the given path was handled correctly and that the parsed options match.
0
       def assert_recognizes(expected_options, path, extras={}, message=nil)
0
         clean_backtrace do
0
           path = "/#{path}" unless path[0..0] == '/'
0
@@ -159,8 +159,8 @@ module Test #:nodoc:
0
         end
0
       end
0
 
0
- # asserts that path and options match both ways, in other words, the URL generated from
0
- # options is same as path, and also that the options recognized from path are same as options
0
+ # Asserts that path and options match both ways; in other words, the URL generated from
0
+ # options is the same as path, and also that the options recognized from path are the same as options
0
       def assert_routing(path, options, defaults={}, extras={}, message=nil)
0
         assert_recognizes(options, path, extras, message)
0
         
...
89
90
91
92
 
93
94
95
...
165
166
167
168
 
169
170
171
...
188
189
190
191
 
192
193
194
...
241
242
243
244
 
245
246
247
...
276
277
278
279
 
280
281
282
...
306
307
308
309
 
310
311
312
...
373
374
375
376
 
377
378
379
...
408
409
410
411
 
412
413
414
...
436
437
438
439
 
440
441
442
...
481
482
483
484
 
485
486
487
...
683
684
685
686
 
687
688
689
...
89
90
91
 
92
93
94
95
...
165
166
167
 
168
169
170
171
...
188
189
190
 
191
192
193
194
...
241
242
243
 
244
245
246
247
...
276
277
278
 
279
280
281
282
...
306
307
308
 
309
310
311
312
...
373
374
375
 
376
377
378
379
...
408
409
410
 
411
412
413
414
...
436
437
438
 
439
440
441
442
...
481
482
483
 
484
485
486
487
...
683
684
685
 
686
687
688
689
0
@@ -89,7 +89,7 @@ module ActionController #:nodoc:
0
   #
0
   # == Parameters
0
   #
0
- # All request parameters whether they come from a GET or POST request, or from the URL, are available through the params hash.
0
+ # All request parameters, whether they come from a GET or POST request, or from the URL, are available through the params hash.
0
   # So an action that was performed through /weblog/list?category=All&limit=5 will include { "category" => "All", "limit" => 5 }
0
   # in params.
0
   #
0
@@ -165,7 +165,7 @@ module ActionController #:nodoc:
0
   # the post again, but rather just show it one more time.
0
   #
0
   # This sounds fairly simple, but the redirection is complicated by the quest for a phenomenon known as "pretty urls". Instead of accepting
0
- # the dreadful beings that is "weblog_controller?action=show&post_id=5", Action Controller goes out of its way to represent the former as
0
+ # the dreadful being that is "weblog_controller?action=show&post_id=5", Action Controller goes out of its way to represent the former as
0
   # "/weblog/show/5". And this is even the simple case. As an example of a more advanced pretty url consider
0
   # "/library/books/ISBN/0743536703/show", which can be mapped to books_controller?action=show&type=ISBN&id=0743536703.
0
   #
0
@@ -188,7 +188,7 @@ module ActionController #:nodoc:
0
   #
0
   # == Calling multiple redirects or renders
0
   #
0
- # An action should conclude by a single render or redirect. Attempting to try to do either again will result in a DoubleRenderError:
0
+ # An action should conclude with a single render or redirect. Attempting to try to do either again will result in a DoubleRenderError:
0
   #
0
   # def do_something
0
   # redirect_to :action => "elsewhere"
0
@@ -241,7 +241,7 @@ module ActionController #:nodoc:
0
     @@debug_routes = true
0
     cattr_accessor :debug_routes
0
 
0
- # Controls whether the application is thread-safe, so multi-threaded servers like WEBrick knows whether to apply a mutex
0
+ # Controls whether the application is thread-safe, so multi-threaded servers like WEBrick know whether to apply a mutex
0
     # around the performance of each action. Action Pack and Active Record are by default thread-safe, but many applications
0
     # may not be. Turned off by default.
0
     @@allow_concurrency = false
0
@@ -276,7 +276,7 @@ module ActionController #:nodoc:
0
     attr_accessor :response
0
     
0
     # Holds a hash of objects in the session. Accessed like <tt>session[:person]</tt> to get the object tied to the "person"
0
- # key. The session will hold any type of object as values, but the key should be a string.
0
+ # key. The session will hold any type of object as values, but the key should be a string or symbol.
0
     attr_accessor :session
0
     
0
     # Holds a hash of header names and values. Accessed like <tt>headers["Cache-Control"]</tt> to get the value of the Cache-Control
0
@@ -306,7 +306,7 @@ module ActionController #:nodoc:
0
         @controller_name ||= controller_class_name.sub(/Controller$/, '').underscore
0
       end
0
       
0
- # Convert the class name from something like "OneModule::TwoModule::NeatController" to "one_module/two_module/neat".
0
+ # Converts the class name from something like "OneModule::TwoModule::NeatController" to "one_module/two_module/neat".
0
       def controller_path
0
         unless @controller_path
0
           components = self.name.to_s.split('::')
0
@@ -373,7 +373,7 @@ 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
+ # 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
@@ -408,7 +408,7 @@ module ActionController #:nodoc:
0
       # The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the
0
       # route given by <tt>map.connect 'people/:last/:first/:action', :action => 'bio', :controller => 'people'</tt>.
0
       #
0
- # Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases URLs which are generated
0
+ # Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases of URLs which are generated
0
       # from this page.
0
       #
0
       # * <tt>url_for :action => 'bio'</tt> -- During the generation of this URL, default values will be used for the first and
0
@@ -436,7 +436,7 @@ module ActionController #:nodoc:
0
       # url_for :overwrite_params => { :action => 'print' }
0
       #
0
       # This takes the current URL as is and only exchanges the action. In contrast, <tt>url_for :action => 'print'</tt>
0
- # would have slashed-off the path components are the changed action.
0
+ # would have slashed-off the path components after the changed action.
0
       def url_for(options = {}, *parameters_for_method_reference) #:doc:
0
         case options
0
           when String then options
0
@@ -481,7 +481,7 @@ module ActionController #:nodoc:
0
       #
0
       # === Rendering partials
0
       #
0
- # Partial rendering is most commonly used together with Ajax calls that only updates one or a few elements on a page
0
+ # Partial rendering is most commonly used together with Ajax calls that only update one or a few elements on a page
0
       # without reloading. Rendering of partials from the controller makes it possible to use the same partial template in
0
       # both the full-page rendering (by calling it from within the template) and when sub-page updates happen (from the
0
       # controller action responding to Ajax calls). By default, the current layout is not used.
0
@@ -683,7 +683,7 @@ module ActionController #:nodoc:
0
         @performed_render = false
0
       end
0
 
0
- # Clears the redirected results from the headers, resetting the status to 200 and returns
0
+ # Clears the redirected results from the headers, resets the status to 200 and returns
0
       # the URL that was used to redirect or nil if there was no redirected URL
0
       # Note that +redirect_to+ will change the body of the response to indicate a redirection.
0
       # The response body is not reset here, see +erase_render_results+
...
18
19
20
21
 
22
23
24
...
140
141
142
143
 
144
145
146
...
228
229
230
231
 
232
233
234
...
481
482
483
484
 
485
486
487
488
489
490
491
 
492
493
494
...
18
19
20
 
21
22
23
24
...
140
141
142
 
143
144
145
146
...
228
229
230
 
231
232
233
234
...
481
482
483
 
484
485
486
487
488
489
490
 
491
492
493
494
0
@@ -18,7 +18,7 @@ module ActionController #:nodoc:
0
     end
0
 
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 the process of dynamically
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
@@ -140,7 +140,7 @@ module ActionController #:nodoc:
0
 
0
     # Action caching is similar to page caching by the fact that the entire output of the response is cached, but unlike page caching,
0
     # every request still goes through the Action Pack. The key benefit of this is that filters are run before the cache is served, which
0
- # allows for authentication and other restrictions on whether someone are supposed to see the cache. Example:
0
+ # allows for authentication and other restrictions on whether someone is allowed to see the cache. Example:
0
     #
0
     # class ListsController < ApplicationController
0
     # before_filter :authenticate, :except => :public
0
@@ -228,7 +228,7 @@ module ActionController #:nodoc:
0
     # In order to use the fragment caching, you need to designate where the caches should be stored. This is done by assigning a fragment store
0
     # of which there are four different kinds:
0
     #
0
- # * FileStore: Keeps the fragments on disk in the +cache_path+, which works well for all types of environments and share the fragments for
0
+ # * FileStore: Keeps the fragments on disk in the +cache_path+, which works well for all types of environments and shares the fragments for
0
     # all the web server processes running off the same application directory.
0
     # * MemoryStore: Keeps the fragments in memory, which is fine for WEBrick and for FCGI (if you don't care that each FCGI process holds its
0
     # own fragment store). It's not suitable for CGI as the process is thrown away at the end of each request. It can potentially also take
0
@@ -481,14 +481,14 @@ module ActionController #:nodoc:
0
     # end
0
     # end
0
     #
0
- # The sweeper is assigned on the controllers that wish to have its job performed using the <tt>cache_sweeper</tt> class method:
0
+ # The sweeper is assigned in the controllers that wish to have its job performed using the <tt>cache_sweeper</tt> class method:
0
     #
0
     # class ListsController < ApplicationController
0
     # caches_action :index, :show, :public, :feed
0
     # cache_sweeper :list_sweeper, :only => [ :edit, :destroy, :share ]
0
     # end
0
     #
0
- # In the example above, four actions are cached and three actions are responsible of expiring those caches.
0
+ # In the example above, four actions are cached and three actions are responsible for expiring those caches.
0
     module Sweeping
0
       def self.append_features(base) #:nodoc:
0
         super
...
1
2
 
3
4
5
...
1
 
2
3
4
5
0
@@ -1,5 +1,5 @@
0
 module ActionController #:nodoc:
0
- # Components allows you to call other actions for their rendered response while execution another action. You can either delegate
0
+ # Components allows you to call other actions for their rendered response while executing another action. You can either delegate
0
   # the entire response rendering or you can mix a partial response in with your other content.
0
   #
0
   # class WeblogController < ActionController::Base
...
1
2
3
 
 
4
5
6
...
43
44
45
46
 
47
48
49
...
1
 
 
2
3
4
5
6
...
43
44
45
 
46
47
48
49
0
@@ -1,6 +1,6 @@
0
 module ActionController #:nodoc:
0
- # Cookies are read and written through ActionController#cookies. The cookies being read is what was received along with the request,
0
- # the cookies being written is what will be sent out will the response. Cookies are read by value (so you won't get the cookie object
0
+ # Cookies are read and written through ActionController#cookies. The cookies being read are what were received along with the request,
0
+ # the cookies being written are what will be sent out with the response. Cookies are read by value (so you won't get the cookie object
0
   # itself back -- just the value it holds). Examples for writing:
0
   #
0
   # cookies[:user_name] = "david" # => Will set a simple session cookie
0
@@ -43,7 +43,7 @@ module ActionController #:nodoc:
0
       update(@cookies)
0
     end
0
 
0
- # Returns the value of the cookie by +name+ -- or nil if no such cookie exist. You set new cookies using either the cookie method
0
+ # Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using either the cookie method
0
     # or cookies[]= (for simple name/value cookies without options).
0
     def [](name)
0
       @cookies[name.to_s].value.first if @cookies[name.to_s] && @cookies[name.to_s].respond_to?(:value)
...
27
28
29
30
 
31
32
33
...
27
28
29
 
30
31
32
33
0
@@ -27,7 +27,7 @@ module ActionController #:nodoc:
0
     # end
0
     #
0
     # Also note, that if the models follow the pattern of just 1 class per file in the form of MyClass => my_class.rb, then these
0
- # classes doesn't have to be required as Active Support will auto-require them.
0
+ # classes don't have to be required as Active Support will auto-require them.
0
     module ClassMethods
0
       # Specifies a variable number of models that this controller depends on. Models are normally Active Record classes or a similar
0
       # backend for modelling entity classes.
...
41
42
43
44
 
45
46
47
...
74
75
76
77
 
78
79
80
...
143
144
145
146
 
147
148
149
...
41
42
43
 
44
45
46
47
...
74
75
76
 
77
78
79
80
...
143
144
145
 
146
147
148
149
0
@@ -41,7 +41,7 @@ module ActionController #:nodoc:
0
     #
0
     # Now any actions performed on the BankController will have the audit method called before. On the VaultController,
0
     # first the audit method is called, then the verify_credentials method. If the audit method returns false, then
0
- # verify_credentials and the intended action is never called.
0
+ # verify_credentials and the intended action are never called.
0
     #
0
     # == Filter types
0
     #
0
@@ -74,7 +74,7 @@ module ActionController #:nodoc:
0
     #
0
     # As you can see, the block expects to be passed the controller after it has assigned the request to the internal variables.
0
     # This means that the block has access to both the request and response objects complete with convenience methods for params,
0
- # session, template, and assigns. Note: The inline method doesn't strictly has to be a block. Any object that responds to call
0
+ # session, template, and assigns. Note: The inline method doesn't strictly have to be a block; any object that responds to call
0
     # and returns 1 or -1 on arity will do (such as a Proc or an Method object).
0
     #
0
     # == Filter chain ordering
0
@@ -143,7 +143,7 @@ module ActionController #:nodoc:
0
     # end
0
     # end
0
     #
0
- # When setting conditions on inline method (proc) filters the condition must come first and be placed in parenthesis.
0
+ # When setting conditions on inline method (proc) filters the condition must come first and be placed in parentheses.
0
     #
0
     # class UserPreferences < ActionController::Base
0
     # before_filter(:except => :new) { # some proc ... }
...
19
20
21
22
 
23
24
25
...
19
20
21
 
22
23
24
25
0
@@ -19,7 +19,7 @@ module ActionController #:nodoc:
0
       end
0
     end
0
 
0
- # The template helpers serves to relieve the templates from including the same inline code again and again. It's a
0
+ # The template helpers serve to relieve the templates from including the same inline code again and again. It's a
0
     # set of standardized methods for working with forms (FormHelper), dates (DateHelper), texts (TextHelper), and
0
     # Active Records (ActiveRecordHelper) that's available to all templates by default.
0
     #
...
24
25
26
27
 
28
29
30
...
24
25
26
 
27
28
29
30
0
@@ -24,7 +24,7 @@ module ActionController #:nodoc:
0
     # and if you ever want to change the structure of these two includes, you'll have to change all the templates.
0
     #
0
     # With layouts, you can flip it around and have the common structure know where to insert changing content. This means
0
- # that the header and footer is only mentioned in one place, like this:
0
+ # that the header and footer are only mentioned in one place, like this:
0
     #
0
     # <!-- The header part of this layout -->
0
     # <%= @content_for_layout %>
...
56
57
58
59
 
60
61
62
...
56
57
58
 
59
60
61
62
0
@@ -56,7 +56,7 @@ module ActionController #:nodoc:
0
         end
0
       end
0
 
0
- # Overwrite to expand the meaning of a local request in order to show local rescues on other occurences than
0
+ # Overwrite to expand the meaning of a local request in order to show local rescues on other occurrences than
0
       # the remote IP being 127.0.0.1. For example, this could include the IP of the developer machine when debugging
0
       # remotely.
0
       def local_request? #:doc:

Comments

    No one has commented yet.