Skip to content
This repository
Browse code

Documentation tweaks and fixes. Closes #9454 [sur, kampers]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7383 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit ed09b621bd0ca0377de8114bcd918ab3aba38abd 1 parent 33e5e41
Jeremy Kemper authored August 31, 2007
2  actionpack/lib/action_controller/assertions.rb
@@ -39,7 +39,7 @@ module ActionController #:nodoc:
39 39
   #
40 40
   # == Testing named routes
41 41
   #
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.
43 43
   # Example:
44 44
   #
45 45
   #  assert_redirected_to page_url(:title => 'foo')
4  actionpack/lib/action_controller/cookies.rb
@@ -44,8 +44,8 @@ def initialize(controller)
44 44
       update(@cookies)
45 45
     end
46 46
 
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).
  47
+    # Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using cookies[]=
  48
+    # (for simple name/value cookies without options).
49 49
     def [](name)
50 50
       @cookies[name.to_s].value.first if @cookies[name.to_s] && @cookies[name.to_s].respond_to?(:value)
51 51
     end
2  actionpack/lib/action_controller/flash.rb
@@ -96,7 +96,7 @@ def keep(k = nil)
96 96
         use(k, false)
97 97
       end
98 98
     
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:
100 100
       #
101 101
       #     flash.discard              # discard the entire flash at the end of the current action
102 102
       #     flash.discard(:warning)    # discard only the "warning" entry at the end of the current action
20  actionpack/lib/action_controller/helpers.rb
@@ -19,16 +19,16 @@ class << self
19 19
     end
20 20
 
21 21
     # 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
23 23
     # by default.
24 24
     #
25 25
     # In addition to using the standard template helpers provided in the Rails framework, creating custom helpers to
26 26
     # extract complicated logic or reusable functionality is strongly encouraged.  By default, the controller will 
27 27
     # 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>.
29 29
     # 
30 30
     # 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.
32 32
     #
33 33
     # ==== Examples
34 34
     # The +to_s+ method from the +Time+ class can be wrapped in a helper method to display a custom message if 
@@ -88,7 +88,7 @@ def add_template_helper(helper_module) #:nodoc:
88 88
       #   helper FooHelper # => includes FooHelper
89 89
       #
90 90
       # 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+.
92 92
       #   helper :all
93 93
       #
94 94
       # Additionally, the +helper+ class method can receive and evaluate a block, making the methods defined available 
@@ -102,7 +102,7 @@ def add_template_helper(helper_module) #:nodoc:
102 102
       #     end
103 103
       #   end
104 104
       # 
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
106 106
       # +symbols+, +strings+, +modules+ and blocks.
107 107
       #   helper(:three, BlindHelper) { def mice() 'mice' end }
108 108
       #
@@ -139,14 +139,14 @@ def helper(*args, &block)
139 139
         master_helper_module.module_eval(&block) if block_given?
140 140
       end
141 141
 
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:
143 144
       #   class ApplicationController < ActionController::Base
144 145
       #     helper_method :current_user
145 146
       #     def current_user
146 147
       #       @current_user ||= User.find(session[:user])
147 148
       #     end
148 149
       #   end
149  
-      # makes the +current_user+ controller method available in the view.
150 150
       def helper_method(*methods)
151 151
         methods.flatten.each do |method|
152 152
           master_helper_module.module_eval <<-end_eval
@@ -157,11 +157,11 @@ def #{method}(*args, &block)
157 157
         end
158 158
       end
159 159
 
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:
161 163
       #   helper_attr :name
162 164
       #   attr_accessor :name
163  
-      # makes the name and name= controller methods available in the view.
164  
-      # The is a convenience wrapper for helper_method.
165 165
       def helper_attr(*attrs)
166 166
         attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") }
167 167
       end
2  actionpack/lib/action_controller/integration.rb
@@ -51,7 +51,7 @@ class Session
51 51
       # A reference to the response instance used by the last request.
52 52
       attr_reader :response
53 53
 
54  
-      # Create an initialize a new Session instance.
  54
+      # Create and initialize a new +Session+ instance.
55 55
       def initialize
56 56
         reset!
57 57
       end

0 notes on commit ed09b62

Please sign in to comment.
Something went wrong with that request. Please try again.