Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #2468: typo_spelling_and_grammar_fixes_in_actionpack_comments.diff

File typo_spelling_and_grammar_fixes_in_actionpack_comments.diff, 20.1 kB (added by coffee2code, 3 years ago)

The aforementioned patch.

  • actionpack/lib/action_controller/components.rb

    old new  
    11module ActionController #:nodoc: 
    2   # Components allows you to call other actions for their rendered response while execution another action. You can either delegate 
     2  # Components allows you to call other actions for their rendered response while executing another action. You can either delegate 
    33  # the entire response rendering or you can mix a partial response in with your other content. 
    44  # 
    55  #   class WeblogController < ActionController::Base 
  • actionpack/lib/action_controller/assertions.rb

    old new  
    88    # In addition to these specific assertions, you also have easy access to various collections that the regular test/unit assertions 
    99    # can be used against. These collections are: 
    1010    # 
    11     # * assigns: Instance variables assigned in the action that's available for the view. 
     11    # * assigns: Instance variables assigned in the action that are available for the view. 
    1212    # * session: Objects being saved in the session. 
    13     # * flash: The flash objects being currently in the session. 
     13    # * flash: The flash objects currently in the session. 
    1414    # * cookies: Cookies being sent to the user on this request. 
    1515    #  
    1616    # These collections can be used just like any other hash: 
     
    2525    # 
    2626    # On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url. 
    2727    # 
    28     # For redirects within the same controller, you can even call follow_redirect and the redirect will be follow triggering another 
     28    # For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another 
    2929    # action call which can then be asserted against. 
    3030    # 
    3131    # == Manipulating the request collections 
    3232    # 
    33     # The collections described above link to the response, so you can test if what the actions were expected to do happen. But 
    34     # some times you also want to manipulate these collections in the request coming in. This is really only relevant for sessions 
     33    # The collections described above link to the response, so you can test if what the actions were expected to do happened. But 
     34    # sometimes you also want to manipulate these collections in the incoming request. This is really only relevant for sessions 
    3535    # and cookies, though. For sessions, you just do: 
    3636    # 
    3737    #   @request.session[:key] = "value" 
     
    6666      end 
    6767 
    6868      # Assert that the redirection options passed in match those of the redirect called in the latest action. This match can be partial, 
    69       # such at assert_redirected_to(:controller => "weblog") will also match the redirection of  
     69      # such that assert_redirected_to(:controller => "weblog") will also match the redirection of  
    7070      # redirect_to(:controller => "weblog", :action => "show") and so on. 
    7171      def assert_redirected_to(options = {}, message=nil) 
    7272        assert_response(:redirect, message) 
     
    112112        end 
    113113      end 
    114114 
    115       # Asserts that the routing of the given path is handled correctly and that the parsed options match. 
     115      # Asserts that the routing of the given path was handled correctly and that the parsed options match. 
    116116      def assert_recognizes(expected_options, path, extras={}, message=nil) 
    117117        path = "/#{path}" unless path[0..0] == '/' 
    118118        # Load routes.rb if it hasn't been loaded. 
     
    149149        assert_block(msg) { expected_path == generated_path } 
    150150      end 
    151151 
    152       # asserts that path and options match both ways, in other words, the URL generated from  
    153       # options is same as path, and also that the options recognized from path are same as options 
     152      # Asserts that path and options match both ways; in other words, the URL generated from  
     153      # options is the same as path, and also that the options recognized from path are the same as options 
    154154      def assert_routing(path, options, defaults={}, extras={}, message=nil) 
    155155        assert_recognizes(options, path, extras, message) 
    156156         
  • actionpack/lib/action_controller/caching.rb

    old new  
    1818    end 
    1919 
    2020    # Page caching is an approach to caching where the entire action output of is stored as a HTML file that the web server  
    21     # can serve without going through the Action Pack. This can be as much as 100 times faster than going the process of dynamically 
     21    # can serve without going through the Action Pack. This can be as much as 100 times faster than going through the process of dynamically 
    2222    # generating the content. Unfortunately, this incredible speed-up is only available to stateless pages where all visitors 
    2323    # are treated the same. Content management systems -- including weblogs and wikis -- have many pages that are a great fit 
    2424    # for this approach, but account-based systems where people log in and manipulate their own data are often less likely candidates. 
     
    140140 
    141141    # Action caching is similar to page caching by the fact that the entire output of the response is cached, but unlike page caching,  
    142142    # every request still goes through the Action Pack. The key benefit of this is that filters are run before the cache is served, which 
    143     # allows for authentication and other restrictions on whether someone are supposed to see the cache. Example: 
     143    # allows for authentication and other restrictions on whether someone is allowed to see the cache. Example: 
    144144    # 
    145145    #   class ListsController < ApplicationController 
    146146    #     before_filter :authenticate, :except => :public 
     
    228228    # 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 
    229229    # of which there are four different kinds: 
    230230    # 
    231     # * FileStore: Keeps the fragments on disk in the +cache_path+, which works well for all types of environments and share the fragments for 
     231    # * FileStore: Keeps the fragments on disk in the +cache_path+, which works well for all types of environments and shares the fragments for 
    232232    #   all the web server processes running off the same application directory. 
    233233    # * 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 
    234234    #   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 
     
    481481    #     end 
    482482    #   end 
    483483    # 
    484     # The sweeper is assigned on the controllers that wish to have its job performed using the <tt>cache_sweeper</tt> class method: 
     484    # The sweeper is assigned in the controllers that wish to have its job performed using the <tt>cache_sweeper</tt> class method: 
    485485    # 
    486486    #   class ListsController < ApplicationController 
    487487    #     caches_action :index, :show, :public, :feed 
    488488    #     cache_sweeper :list_sweeper, :only => [ :edit, :destroy, :share ] 
    489489    #   end 
    490490    # 
    491     # In the example above, four actions are cached and three actions are responsible of expiring those caches. 
     491    # In the example above, four actions are cached and three actions are responsible for expiring those caches. 
    492492    module Sweeping 
    493493      def self.append_features(base) #:nodoc: 
    494494        super 
  • actionpack/lib/action_controller/base.rb

    old new  
    8585  # 
    8686  # == Parameters 
    8787  # 
    88   # All request parameters whether they come from a GET or POST request, or from the URL, are available through the params hash. 
     88  # All request parameters, whether they come from a GET or POST request, or from the URL, are available through the params hash. 
    8989  # So an action that was performed through /weblog/list?category=All&limit=5 will include { "category" => "All", "limit" => 5 } 
    9090  # in params. 
    9191  # 
     
    161161  # the post again, but rather just show it one more time. 
    162162  #  
    163163  # This sounds fairly simple, but the redirection is complicated by the quest for a phenomenon known as "pretty urls". Instead of accepting 
    164   # the dreadful beings that is "weblog_controller?action=show&post_id=5", Action Controller goes out of its way to represent the former as 
     164  # the dreadful being that is "weblog_controller?action=show&post_id=5", Action Controller goes out of its way to represent the former as 
    165165  # "/weblog/show/5". And this is even the simple case. As an example of a more advanced pretty url consider 
    166166  # "/library/books/ISBN/0743536703/show", which can be mapped to books_controller?action=show&type=ISBN&id=0743536703. 
    167167  #  
     
    184184  # 
    185185  # == Calling multiple redirects or renders 
    186186  # 
    187   # An action should conclude by a single render or redirect. Attempting to try to do either again will result in a DoubleRenderError: 
     187  # An action should conclude with a single render or redirect. Attempting to try to do either again will result in a DoubleRenderError: 
    188188  # 
    189189  #   def do_something 
    190190  #     redirect_to :action => "elsewhere" 
     
    237237    @@debug_routes = true 
    238238    cattr_accessor :debug_routes 
    239239 
    240     # Controls whether the application is thread-safe, so multi-threaded servers like WEBrick knows whether to apply a mutex 
     240    # Controls whether the application is thread-safe, so multi-threaded servers like WEBrick know whether to apply a mutex 
    241241    # around the performance of each action. Action Pack and Active Record are by default thread-safe, but many applications 
    242242    # may not be. Turned off by default. 
    243243    @@allow_concurrency = false 
     
    272272    attr_accessor :response 
    273273     
    274274    # Holds a hash of objects in the session. Accessed like <tt>session[:person]</tt> to get the object tied to the "person" 
    275     # key. The session will hold any type of object as values, but the key should be a string
     275    # key. The session will hold any type of object as values, but the key should be a string or symbol
    276276    attr_accessor :session 
    277277     
    278278    # Holds a hash of header names and values. Accessed like <tt>headers["Cache-Control"]</tt> to get the value of the Cache-Control 
     
    302302        @controller_name ||= controller_class_name.sub(/Controller$/, '').underscore 
    303303      end 
    304304       
    305       # Convert the class name from something like "OneModule::TwoModule::NeatController" to "one_module/two_module/neat". 
     305      # Converts the class name from something like "OneModule::TwoModule::NeatController" to "one_module/two_module/neat". 
    306306      def controller_path 
    307307        unless @controller_path 
    308308          components = self.name.to_s.split('::') 
     
    369369      #   
    370370      # <tt>url_for</tt> is used to: 
    371371      #   
    372       # All keys given to url_for are forwarded to the Route module save for the following: 
     372      # All keys given to url_for are forwarded to the Route module, save for the following: 
    373373      # * <tt>:anchor</tt> -- specifies the anchor name to be appended to the path. For example,  
    374374      #   <tt>url_for :controller => 'posts', :action => 'show', :id => 10, :anchor => 'comments'</tt>  
    375375      #   will produce "/posts/show/10#comments". 
     
    404404      # The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the 
    405405      # route given by <tt>map.connect 'people/:last/:first/:action', :action => 'bio', :controller => 'people'</tt>. 
    406406      # 
    407       # Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases URLs which are generated 
     407      # Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases of URLs which are generated 
    408408      # from this page. 
    409409      # 
    410410      # * <tt>url_for :action => 'bio'</tt> -- During the generation of this URL, default values will be used for the first and 
     
    432432      #   url_for :overwrite_params => { :action => 'print' } 
    433433      # 
    434434      # This takes the current URL as is and only exchanges the action. In contrast, <tt>url_for :action => 'print'</tt> 
    435       # would have slashed-off the path components are the changed action. 
     435      # would have slashed-off the path components after the changed action. 
    436436      def url_for(options = {}, *parameters_for_method_reference) #:doc: 
    437437        case options 
    438438          when String then options 
     
    477477      # 
    478478      # === Rendering partials 
    479479      #  
    480       # Partial rendering is most commonly used together with Ajax calls that only updates one or a few elements on a page 
     480      # Partial rendering is most commonly used together with Ajax calls that only update one or a few elements on a page 
    481481      # without reloading. Rendering of partials from the controller makes it possible to use the same partial template in 
    482482      # both the full-page rendering (by calling it from within the template) and when sub-page updates happen (from the 
    483483      # controller action responding to Ajax calls). By default, the current layout is not used. 
     
    677677        @performed_render = false 
    678678      end 
    679679 
    680       # Clears the redirected results from the headers, resetting the status to 200 and returns  
     680      # Clears the redirected results from the headers, resets the status to 200 and returns  
    681681      # the URL that was used to redirect or nil if there was no redirected URL 
    682682      # Note that +redirect_to+ will change the body of the response to indicate a redirection. 
    683683      # The response body is not reset here, see +erase_render_results+ 
  • actionpack/lib/action_controller/layout.rb

    old new  
    2424    # and if you ever want to change the structure of these two includes, you'll have to change all the templates. 
    2525    # 
    2626    # With layouts, you can flip it around and have the common structure know where to insert changing content. This means 
    27     # that the header and footer is only mentioned in one place, like this: 
     27    # that the header and footer are only mentioned in one place, like this: 
    2828    # 
    2929    #   <!-- The header part of this layout --> 
    3030    #   <%= @content_for_layout %> 
  • actionpack/lib/action_controller/dependencies.rb

    old new  
    2727    #   end 
    2828    # 
    2929    # 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 
    30     # classes doesn't have to be required as Active Support will auto-require them. 
     30    # classes don't have to be required as Active Support will auto-require them. 
    3131    module ClassMethods 
    3232      # Specifies a variable number of models that this controller depends on. Models are normally Active Record classes or a similar 
    3333      # backend for modelling entity classes. 
  • actionpack/lib/action_controller/rescue.rb

    old new  
    5656        end 
    5757      end 
    5858 
    59       # Overwrite to expand the meaning of a local request in order to show local rescues on other occurences than 
     59      # Overwrite to expand the meaning of a local request in order to show local rescues on other occurrences than 
    6060      # the remote IP being 127.0.0.1. For example, this could include the IP of the developer machine when debugging 
    6161      # remotely. 
    6262      def local_request? #:doc: 
  • actionpack/lib/action_controller/cookies.rb

    old new  
    11module ActionController #:nodoc: 
    2   # Cookies are read and written through ActionController#cookies. The cookies being read is what was received along with the request, 
    3   # 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 
     2  # Cookies are read and written through ActionController#cookies. The cookies being read are what were received along with the request, 
     3  # 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 
    44  # itself back -- just the value it holds). Examples for writing: 
    55  # 
    66  #   cookies[:user_name] = "david" # => Will set a simple session cookie 
     
    4343      update(@cookies) 
    4444    end 
    4545 
    46     # Returns the value of the cookie by +name+ -- or nil if no such cookie exist. You set new cookies using either the cookie method 
     46    # Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using either the cookie method 
    4747    # or cookies[]= (for simple name/value cookies without options). 
    4848    def [](name) 
    4949      @cookies[name.to_s].value.first if @cookies[name.to_s] && @cookies[name.to_s].respond_to?(:value) 
  • actionpack/lib/action_controller/helpers.rb

    old new  
    1919      end 
    2020    end 
    2121 
    22     # The template helpers serves to relieve the templates from including the same inline code again and again. It's a 
     22    # The template helpers serve to relieve the templates from including the same inline code again and again. It's a 
    2323    # set of standardized methods for working with forms (FormHelper), dates (DateHelper), texts (TextHelper), and  
    2424    # Active Records (ActiveRecordHelper) that's available to all templates by default. 
    2525    # 
  • actionpack/lib/action_controller/filters.rb

    old new  
    4141    # 
    4242    # Now any actions performed on the BankController will have the audit method called before. On the VaultController, 
    4343    # first the audit method is called, then the verify_credentials method. If the audit method returns false, then  
    44     # verify_credentials and the intended action is never called. 
     44    # verify_credentials and the intended action are never called. 
    4545    # 
    4646    # == Filter types 
    4747    # 
     
    7474    # 
    7575    # As you can see, the block expects to be passed the controller after it has assigned the request to the internal variables. 
    7676    # This means that the block has access to both the request and response objects complete with convenience methods for params, 
    77     # session, template, and assigns. Note: The inline method doesn't strictly has to be a block. Any object that responds to call 
     77    # session, template, and assigns. Note: The inline method doesn't strictly have to be a block; any object that responds to call 
    7878    # and returns 1 or -1 on arity will do (such as a Proc or an Method object). 
    7979    # 
    8080    # == Filter chain ordering 
     
    143143    #       end 
    144144    #   end 
    145145    #  
    146     # When setting conditions on inline method (proc) filters the condition must come first and be placed in parenthesis. 
     146    # When setting conditions on inline method (proc) filters the condition must come first and be placed in parentheses. 
    147147    # 
    148148    #   class UserPreferences < ActionController::Base 
    149149    #     before_filter(:except => :new) { # some proc ... }