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

Ticket #9454: action_controller_docs_typos_fixed.2.diff

File action_controller_docs_typos_fixed.2.diff, 6.2 kB (added by kampers, 1 year ago)
  • actionpack/lib/action_controller/assertions.rb

    old new  
    3939  # 
    4040  # == Testing named routes 
    4141  # 
    42   # If you're using named routes, they can be easily tested using the original named routes methods straight in the test case. 
     42  # If you're using named routes, they can be easily tested using the original named routes' methods straight in the test case. 
    4343  # Example: 
    4444  # 
    4545  #  assert_redirected_to page_url(:title => 'foo') 
  • actionpack/lib/action_controller/integration.rb

    old new  
    5151      # A reference to the response instance used by the last request. 
    5252      attr_reader :response 
    5353 
    54       # Create an initialize a new Session instance. 
     54      # Create and initialize a new +Session+ instance. 
    5555      def initialize 
    5656        reset! 
    5757      end 
  • actionpack/lib/action_controller/cookies.rb

    old new  
    4450      update(@cookies) 
    4551    end 
    4652 
    47     # Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using either the cookie method 
    48     # or cookies[]= (for simple name/value cookies without options). 
     53    # Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using cookies[]= 
     54    # (for simple name/value cookies without options). 
    4955    def [](name) 
    5056      @cookies[name.to_s].value.first if @cookies[name.to_s] && @cookies[name.to_s].respond_to?(:value) 
    5157    end 
  • actionpack/lib/action_controller/flash.rb

    old new  
    9696        use(k, false) 
    9797      end 
    9898     
    99       # Marks the entire flash or a single flash entry to be discarded by the end of the current action 
     99      # Marks the entire flash or a single flash entry to be discarded by the end of the current action: 
    100100      # 
    101101      #     flash.discard              # discard the entire flash at the end of the current action 
    102102      #     flash.discard(:warning)    # discard only the "warning" entry at the end of the current action 
  • actionpack/lib/action_controller/helpers.rb

    old new  
    1919    end 
    2020 
    2121    # The Rails framework provides a large number of helpers for working with +assets+, +dates+, +forms+,  
    22     # +numbers+ and <tt>Active Record objects</tt>, to name a few. These helpers are available to all templates 
     22    # +numbers+ and +ActiveRecord+ objects, to name a few. These helpers are available to all templates 
    2323    # by default. 
    2424    # 
    2525    # In addition to using the standard template helpers provided in the Rails framework, creating custom helpers to 
    2626    # extract complicated logic or reusable functionality is strongly encouraged.  By default, the controller will  
    2727    # include a helper whose name matches that of the controller, e.g., <tt>MyController</tt> will automatically 
    28     # include <tt>MyHelper</tt>.   
     28    # include <tt>MyHelper</tt>. 
    2929    #  
    3030    # Additional helpers can be specified using the +helper+ class method in <tt>ActionController::Base</tt> or any 
    31     # controller which inherits from it.   
     31    # controller which inherits from it. 
    3232    # 
    3333    # ==== Examples 
    3434    # The +to_s+ method from the +Time+ class can be wrapped in a helper method to display a custom message if  
     
    8888      #   helper FooHelper # => includes FooHelper 
    8989      # 
    9090      # When the argument is the symbol <tt>:all</tt>, the controller will includes all helpers from  
    91       # <tt>app/views/helpers/**/*.rb</tt> under RAILS_ROOT 
     91      # <tt>app/views/helpers/**/*.rb</tt> under +RAILS_ROOT+. 
    9292      #   helper :all 
    9393      # 
    9494      # Additionally, the +helper+ class method can receive and evaluate a block, making the methods defined available  
     
    102102      #     end 
    103103      #   end 
    104104      #  
    105       # Finally, all the above styles can be mixed together, and the helper method can be invokved with a mix of 
     105      # Finally, all the above styles can be mixed together, and the +helper+ method can be invokved with a mix of 
    106106      # +symbols+, +strings+, +modules+ and blocks. 
    107107      #   helper(:three, BlindHelper) { def mice() 'mice' end } 
    108108      # 
     
    139139        master_helper_module.module_eval(&block) if block_given? 
    140140      end 
    141141 
    142       # Declare a controller method as a helper.  For example, 
     142      # Declare a controller method as a helper. For example, the following 
     143      # makes the +current_user+ controller method available to the view: 
    143144      #   class ApplicationController < ActionController::Base 
    144145      #     helper_method :current_user 
    145146      #     def current_user 
    146147      #       @current_user ||= User.find(session[:user]) 
    147148      #     end 
    148149      #   end 
    149       # makes the +current_user+ controller method available in the view. 
    150150      def helper_method(*methods) 
    151151        methods.flatten.each do |method| 
    152152          master_helper_module.module_eval <<-end_eval 
     
    157157        end 
    158158      end 
    159159 
    160       # Declare a controller attribute as a helper.  For example, 
     160      # Declares helper accessors for controller attributes. For example, the 
     161      # following adds new +name+ and <tt>name=</tt> instance methods to a 
     162      # controller and makes them available to the view: 
    161163      #   helper_attr :name 
    162164      #   attr_accessor :name 
    163       # makes the name and name= controller methods available in the view. 
    164       # The is a convenience wrapper for helper_method. 
    165165      def helper_attr(*attrs) 
    166166        attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") } 
    167167      end