public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Improve documentation coverage and markup
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
fxn (author)
Fri May 02 06:45:23 -0700 2008
lifo (committer)
Fri May 02 06:45:23 -0700 2008
commit  64092de25727c1943807bf5345107d90428135a0
tree    87977e3b0c839fb6adb417949676bb5384155526
parent  87ec72bd8c4b5d178ba7a41e605bc9a8e27f9e67
...
198
199
200
201
 
202
203
204
205
206
 
207
208
209
210
211
212
213
 
214
215
 
216
217
218
219
220
 
221
222
223
224
225
 
226
227
228
...
198
199
200
 
201
202
203
204
205
 
206
207
208
209
210
211
212
 
213
214
 
215
216
217
218
219
 
220
221
222
223
224
 
225
226
227
228
0
@@ -198,31 +198,31 @@ module ActionMailer #:nodoc:
0
   #
0
   # These options are specified on the class level, like <tt>ActionMailer::Base.template_root = "/my/templates"</tt>
0
   #
0
-  # * <tt>template_root</tt> - template root determines the base from which template references will be made.
0
+  # * <tt>template_root</tt> - Determines the base from which template references will be made.
0
   #
0
   # * <tt>logger</tt> - the logger is used for generating information on the mailing run if available.
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 :smtp delivery method:
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
-  #     This is a symbol and one of :plain, :login, :cram_md5
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 :sendmail delivery method
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
   #
0
-  # * <tt>delivery_method</tt> - Defines a delivery method. Possible values are :smtp (default), :sendmail, and :test.
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
   #   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 delivery_method :test. Most useful
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
   #   for unit and functional testing.
0
   #
0
   # * <tt>default_charset</tt> - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also 
...
332
333
334
335
 
 
336
337
338
...
544
545
546
547
548
 
 
549
550
551
...
598
599
600
601
 
602
603
604
...
769
770
771
772
 
773
774
775
...
823
824
825
826
 
827
828
829
...
332
333
334
 
335
336
337
338
339
...
545
546
547
 
 
548
549
550
551
552
...
599
600
601
 
602
603
604
605
...
770
771
772
 
773
774
775
776
...
824
825
826
 
827
828
829
830
0
@@ -332,7 +332,8 @@ module ActionController #:nodoc:
0
     @@resources_path_names = { :new => 'new', :edit => 'edit' }
0
     cattr_accessor :resources_path_names
0
 
0
-    # Sets the token parameter name for RequestForgery.  Calling #protect_from_forgery sets it to :authenticity_token by default
0
+    # Sets the token parameter name for RequestForgery. Calling +protect_from_forgery+
0
+    # sets it to <tt>:authenticity_token</tt> by default.
0
     cattr_accessor :request_forgery_protection_token
0
 
0
     # Indicates whether or not optimise the generated named
0
@@ -544,8 +545,8 @@ module ActionController #:nodoc:
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 :password is also present).
0
-      # * <tt>:password</tt> -- Inline HTTP authentication (only plucked out if :user is also present).
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
       #
0
@@ -598,7 +599,7 @@ module ActionController #:nodoc:
0
       #   url_for :controller => 'posts', :action => nil
0
       #
0
       # If you explicitly want to create a URL that's almost the same as the current URL, you can do so using the
0
-      # :overwrite_params options. Say for your posts you have different views for showing and printing them.
0
+      # <tt>:overwrite_params</tt> options. Say for your posts you have different views for showing and printing them.
0
       # Then, in the show view, you get the URL for the print view like this
0
       #
0
       #   url_for :overwrite_params => { :action => 'print' }
0
@@ -769,7 +770,7 @@ module ActionController #:nodoc:
0
       #   # placed in "app/views/layouts/special.r(html|xml)"
0
       #   render :text => "Hi there!", :layout => "special"
0
       #
0
-      # The :text option can also accept a Proc object, which can be used to manually control the page generation. This should
0
+      # The <tt>:text</tt> option can also accept a Proc object, which can be used to manually control the page generation. This should
0
       # generally be avoided, as it violates the separation between code and content, and because almost everything that can be
0
       # done with this method can also be done more cleanly using one of the other rendering methods, most notably templates.
0
       #
0
@@ -823,7 +824,7 @@ module ActionController #:nodoc:
0
       #
0
       # === Rendering with status and location headers
0
       #
0
-      # All renders take the :status and :location options and turn them into headers. They can even be used together:
0
+      # All renders take the <tt>:status</tt> and <tt>:location</tt> options and turn them into headers. They can even be used together:
0
       #
0
       #   render :xml => post.to_xml, :status => :created, :location => post_url(post)
0
       def render(options = nil, extra_options = {}, &block) #:doc:
...
1
2
3
4
 
5
6
 
 
 
 
 
 
 
 
 
 
7
8
9
10
11
12
13
 
14
15
16
17
18
19
 
20
21
22
23
24
25
26
27
28
 
 
 
 
 
 
 
 
 
29
30
31
...
45
46
47
48
49
 
50
51
52
...
54
55
56
 
 
57
58
59
...
66
67
68
69
70
 
 
71
72
73
74
75
76
 
 
 
 
77
78
79
...
1
 
 
 
2
3
 
4
5
6
7
8
9
10
11
12
13
14
 
15
16
17
18
 
19
20
21
22
23
24
 
25
26
 
 
 
 
 
 
 
 
27
28
29
30
31
32
33
34
35
36
37
38
...
52
53
54
 
 
55
56
57
58
...
60
61
62
63
64
65
66
67
...
74
75
76
 
 
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
0
@@ -1,31 +1,38 @@
0
 module ActionController #:nodoc:
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
+  # Cookies are read and written through ActionController#cookies.
0
   #
0
-  #   cookies[:user_name] = "david" # => Will set a simple session cookie
0
+  # The cookies being read are the ones received along with the request, the cookies
0
+  # being written will be sent out with the response. Reading a cookie does not get
0
+  # the cookie object itself back, just the value it holds.
0
+  #
0
+  # Examples for writing:
0
+  #
0
+  #   # Sets a simple session cookie.
0
+  #   cookies[:user_name] = "david"
0
+  #
0
+  #   # Sets a cookie that expires in 1 hour.
0
   #   cookies[:login] = { :value => "XJ-122", :expires => 1.hour.from_now }
0
-  #   # => Will set a cookie that expires in 1 hour
0
   #
0
   # Examples for reading:
0
   #
0
   #   cookies[:user_name] # => "david"
0
-  #   cookies.size         # => 2
0
+  #   cookies.size        # => 2
0
   #
0
   # Example for deleting:
0
   #
0
   #   cookies.delete :user_name
0
   #
0
-  # All the option symbols for setting cookies are:
0
+  # The option symbols for setting cookies are:
0
   #
0
-  # * <tt>value</tt> - the cookie's value or list of values (as an array).
0
-  # * <tt>path</tt> - the path for which this cookie applies.  Defaults to the root of the application.
0
-  # * <tt>domain</tt> - the domain for which this cookie applies.
0
-  # * <tt>expires</tt> - the time at which this cookie expires, as a +Time+ object.
0
-  # * <tt>secure</tt> - whether this cookie is a secure cookie or not (default to false).
0
-  #                     Secure cookies are only transmitted to HTTPS servers.
0
-  # * <tt>http_only</tt> - whether this cookie is accessible via scripting or only HTTP (defaults to false).
0
-  
0
+  # * <tt>:value</tt> - The cookie's value or list of values (as an array).
0
+  # * <tt>:path</tt> - The path for which this cookie applies.  Defaults to the root
0
+  #   of the application.
0
+  # * <tt>:domain</tt> - The domain for which this cookie applies.
0
+  # * <tt>:expires</tt> - The time at which this cookie expires, as a Time object.
0
+  # * <tt>:secure</tt> - Whether this cookie is a only transmitted to HTTPS servers.
0
+  #   Default is +false+.
0
+  # * <tt>:http_only</tt> - Whether this cookie is accessible via scripting or
0
+  #   only HTTP. Defaults to +false+.
0
   module Cookies
0
     def self.included(base)
0
       base.helper_method :cookies
0
@@ -45,8 +52,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 exists. You set new cookies using cookies[]=
0
-    # (for simple name/value cookies without options).
0
+    # Returns the value of the cookie by +name+, or +nil+ if no such cookie exists.
0
     def [](name)
0
       cookie = @cookies[name.to_s]
0
       if cookie && cookie.respond_to?(:value)
0
@@ -54,6 +60,8 @@ module ActionController #:nodoc:
0
       end
0
     end
0
 
0
+    # Sets the cookie named +name+. The second argument may be the very cookie
0
+    # value, or a hash of options as documented above.
0
     def []=(name, options)
0
       if options.is_a?(Hash)
0
         options = options.inject({}) { |options, pair| options[pair.first.to_s] = pair.last; options }
0
@@ -66,14 +74,18 @@ module ActionController #:nodoc:
0
     end
0
 
0
     # Removes the cookie on the client machine by setting the value to an empty string
0
-    # and setting its expiration date into the past.  Like []=, you can pass in an options
0
-    # hash to delete cookies with extra data such as a +path+.
0
+    # and setting its expiration date into the past. Like <tt>[]=</tt>, you can pass in
0
+    # an options hash to delete cookies with extra data such as a <tt>:path</tt>.
0
     def delete(name, options = {})
0
       options.stringify_keys!
0
       set_cookie(options.merge("name" => name.to_s, "value" => "", "expires" => Time.at(0)))
0
     end
0
 
0
     private
0
+      # Builds a CGI::Cookie object and adds the cookie to the response headers.
0
+      #
0
+      # The path of the cookie defaults to "/" if there's none in +options+, and
0
+      # everything is passed to the CGI::Cookie constructor.
0
       def set_cookie(options) #:doc:
0
         options["path"] = "/" unless options["path"]
0
         cookie = CGI::Cookie.new(options)
...
126
127
128
129
130
 
 
131
132
133
...
191
192
193
194
195
 
 
 
196
197
198
...
126
127
128
 
 
129
130
131
132
133
...
191
192
193
 
 
194
195
196
197
198
199
0
@@ -126,8 +126,8 @@ module ActionController #:nodoc:
0
     #   end
0
     #
0
     # To use a filter object with around_filter, pass an object responding
0
-    # to :filter or both :before and :after. With a filter method, yield to
0
-    # the block as above:
0
+    # to <tt>:filter</tt> or both <tt>:before</tt> and <tt>:after</tt>. With a
0
+    # filter method, yield to the block as above:
0
     #
0
     #   around_filter BenchmarkingFilter
0
     #
0
@@ -191,8 +191,9 @@ module ActionController #:nodoc:
0
     # == Filter conditions
0
     #
0
     # Filters may be limited to specific actions by declaring the actions to
0
-    # include or exclude. Both options accept single actions (:only => :index)
0
-    # or arrays of actions (:except => [:foo, :bar]).
0
+    # include or exclude. Both options accept single actions
0
+    # (<tt>:only => :index</tt>) or arrays of actions
0
+    # (<tt>:except => [:foo, :bar]</tt>).
0
     #
0
     #   class Journal < ActionController::Base
0
     #     # Require authentication for edit and delete.
...
143
144
145
146
 
 
147
148
 
149
 
 
 
 
150
 
 
 
151
152
153
...
143
144
145
 
146
147
148
 
149
150
151
152
153
154
155
156
157
158
159
160
161
0
@@ -143,11 +143,19 @@ module ActionController #:nodoc:
0
       # Declare a controller method as a helper. For example, the following
0
       # makes the +current_user+ controller method available to the view:
0
       #   class ApplicationController < ActionController::Base
0
-      #     helper_method :current_user
0
+      #     helper_method :current_user, :logged_in?
0
+      #
0
       #     def current_user
0
-      #       @current_user ||= User.find(session[:user])
0
+      #       @current_user ||= User.find_by_id(session[:user])
0
       #     end
0
+      #
0
+      #      def logged_in?
0
+      #        current_user != nil
0
+      #      end
0
       #   end
0
+      #
0
+      # In a view:
0
+      #  <% if logged_in? -%>Welcome, <%= current_user.name %><% end -%>
0
       def helper_method(*methods)
0
         methods.flatten.each do |method|
0
           master_helper_module.module_eval <<-end_eval
...
19
20
21
22
 
23
24
25
...
19
20
21
 
22
23
24
25
0
@@ -19,7 +19,7 @@ module ActionController
0
   # * <tt>url_for</tt>, so you can use it with a record as the argument, e.g.
0
   #   <tt>url_for(@article)</tt>;
0
   # * ActionView::Helpers::FormHelper uses <tt>polymorphic_path</tt>, so you can write
0
-  #   <tt>form_for(@article)</tt> without having to specify :url parameter for the form
0
+  #   <tt>form_for(@article)</tt> without having to specify <tt>:url</tt> parameter for the form
0
   #   action;
0
   # * <tt>redirect_to</tt> (which, in fact, uses <tt>url_for</tt>) so you can write
0
   #   <tt>redirect_to(post)</tt> in your controllers;
...
15
16
17
18
 
19
20
21
...
28
29
30
31
32
 
 
33
34
35
36
37
38
 
39
40
41
42
43
 
44
45
46
47
48
 
49
50
51
52
53
 
54
55
56
57
58
59
 
 
60
61
62
...
15
16
17
 
18
19
20
21
...
28
29
30
 
 
31
32
33
34
35
36
37
 
38
39
40
41
42
 
43
44
45
46
47
 
48
49
50
51
52
 
53
54
55
56
57
 
 
58
59
60
61
62
0
@@ -15,7 +15,7 @@ module ActionController
0
     # such as { 'RAILS_ENV' => 'production' }.
0
     attr_reader :env
0
 
0
-    # The true HTTP request method as a lowercase symbol, such as :get.
0
+    # The true HTTP request method as a lowercase symbol, such as <tt>:get</tt>.
0
     # UnknownHttpMethod is raised for invalid methods not listed in ACCEPTED_HTTP_METHODS.
0
     def request_method
0
       @request_method ||= begin
0
@@ -28,35 +28,35 @@ module ActionController
0
       end
0
     end
0
 
0
-    # The HTTP request method as a lowercase symbol, such as :get.
0
-    # Note, HEAD is returned as :get since the two are functionally
0
+    # The HTTP request method as a lowercase symbol, such as <tt>:get</tt>.
0
+    # Note, HEAD is returned as <tt>:get</tt> since the two are functionally
0
     # equivalent from the application's perspective.
0
     def method
0
       request_method == :head ? :get : request_method
0
     end
0
 
0
-    # Is this a GET (or HEAD) request?  Equivalent to request.method == :get
0
+    # Is this a GET (or HEAD) request?  Equivalent to <tt>request.method == :get</tt>.
0
     def get?
0
       method == :get
0
     end
0
 
0
-    # Is this a POST request?  Equivalent to request.method == :post
0
+    # Is this a POST request?  Equivalent to <tt>request.method == :post</tt>.
0
     def post?
0
       request_method == :post
0
     end
0
 
0
-    # Is this a PUT request?  Equivalent to request.method == :put
0
+    # Is this a PUT request?  Equivalent to <tt>request.method == :put</tt>.
0
     def put?
0
       request_method == :put
0
     end
0
 
0
-    # Is this a DELETE request?  Equivalent to request.method == :delete
0
+    # Is this a DELETE request?  Equivalent to <tt>request.method == :delete</tt>.
0
     def delete?
0
       request_method == :delete
0
     end
0
 
0
-    # Is this a HEAD request? request.method sees HEAD as :get, so check the
0
-    # HTTP method directly.
0
+    # Is this a HEAD request? <tt>request.method</tt> sees HEAD as <tt>:get</tt>,
0
+    # so check the HTTP method directly.
0
     def head?
0
       request_method == :head
0
     end
...
102
103
104
105
 
 
106
107
108
...
102
103
104
 
105
106
107
108
109
0
@@ -102,7 +102,8 @@ module ActionController #:nodoc:
0
         request.format.html? || request.format.js?
0
       end
0
     
0
-      # Sets the token value for the current session.  Pass a :secret option in #protect_from_forgery to add a custom salt to the hash.
0
+      # Sets the token value for the current session.  Pass a <tt>:secret</tt> option
0
+      # in +protect_from_forgery+ to add a custom salt to the hash.
0
       def form_authenticity_token
0
         @form_authenticity_token ||= if request_forgery_protection_options[:secret]
0
           authenticity_token_from_session_id
...
58
59
60
61
62
 
 
 
63
64
65
66
67
68
69
 
 
70
71
72
73
 
 
 
74
75
76
77
78
79
80
81
 
 
82
83
84
85
86
87
 
 
 
 
 
 
 
 
 
88
89
90
...
58
59
60
 
 
61
62
63
64
65
66
67
68
69
 
70
71
72
 
 
 
73
74
75
76
 
 
 
 
 
 
 
77
78
79
80
 
 
 
 
81
82
83
84
85
86
87
88
89
90
91
92
0
@@ -58,33 +58,35 @@ module ActionController #:nodoc:
0
       # Rescue exceptions raised in controller actions.
0
       #
0
       # <tt>rescue_from</tt> receives a series of exception classes or class
0
-      # names, and a trailing :with option with the name of a method or a Proc
0
-      # object to be called to handle them. Alternatively a block can be given.
0
+      # names, and a trailing <tt>:with</tt> option with the name of a method
0
+      # or a Proc object to be called to handle them. Alternatively a block can
0
+      # be given.
0
       #
0
       # Handlers that take one argument will be called with the exception, so
0
       # that the exception can be inspected when dealing with it.
0
       #
0
       # Handlers are inherited. They are searched from right to left, from
0
       # bottom to top, and up the hierarchy. The handler of the first class for
0
-      # which exception.is_a?(klass) holds true is the one invoked, if any.
0
+      # which <tt>exception.is_a?(klass)</tt> holds true is the one invoked, if
0
+      # any.
0
       #
0
-      # class ApplicationController < ActionController::Base
0
-      #   rescue_from User::NotAuthorized, :with => :deny_access # self defined exception
0
-      #   rescue_from ActiveRecord::RecordInvalid, :with => :show_errors
0
+      #   class ApplicationController < ActionController::Base
0
+      #     rescue_from User::NotAuthorized, :with => :deny_access # self defined exception
0
+      #     rescue_from ActiveRecord::RecordInvalid, :with => :show_errors
0
       #
0
-      #   rescue_from 'MyAppError::Base' do |exception|
0
-      #     render :xml => exception, :status => 500
0
-      #   end
0
-      #
0
-      #   protected
0
-      #     def deny_access
0
-      #       ...
0
+      #     rescue_from 'MyAppError::Base' do |exception|
0
+      #       render :xml => exception, :status => 500
0
       #     end
0
       #
0
-      #     def show_errors(exception)
0
-      #       exception.record.new_record? ? ...
0
-      #     end
0
-      # end
0
+      #     protected
0
+      #       def deny_access
0
+      #         ...
0
+      #       end
0
+      #
0
+      #       def show_errors(exception)
0
+      #         exception.record.new_record? ? ...
0
+      #       end
0
+      #   end
0
       def rescue_from(*klasses, &block)
0
         options = klasses.extract_options!
0
         unless options.has_key?(:with)
...
240
241
242
243
244
 
 
245
246
247
248
 
249
250
251
...
254
255
256
257
 
258
259
260
...
288
289
290
291
 
292
293
294
...
302
303
304
305
 
306
307
308
...
364
365
366
367
 
368
369
370
...
240
241
242
 
 
243
244
245
246
247
 
248
249
250
251
...
254
255
256
 
257
258
259
260
...
288
289
290
 
291
292
293
294
...
302
303
304
 
305
306
307
308
...
364
365
366
 
367
368
369
370
0
@@ -240,12 +240,12 @@ module ActionController
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 :collection, but for actions that operate on a specific member.
0
-    # * <tt>:new</tt> - same as :collection, but for actions that operate on the new resource action.
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 :method value for the method-specific routes.
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
@@ -254,7 +254,7 @@ module ActionController
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 :has_one, but for plural resources.
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
     #
0
@@ -288,7 +288,7 @@ module ActionController
0
     #       article.resources :comments
0
     #     end
0
     #
0
-    #   The comment resources work the same, but must now include a value for :article_id.
0
+    #   The comment resources work the same, but must now include a value for <tt>:article_id</tt>.
0
     #
0
     #     article_comments_url(@article)
0
     #     article_comment_url(@article, @comment)
0
@@ -302,7 +302,7 @@ module ActionController
0
     #     map.resources :tags, :path_prefix => '/books/:book_id', :name_prefix => 'book_'
0
     #     map.resources :tags, :path_prefix => '/toys/:toy_id',   :name_prefix => 'toy_'
0
     #
0
-    # You may also use :name_prefix to override the generic named routes in a nested resource:
0
+    # You may also use <tt>:name_prefix</tt> to override the generic named routes in a nested resource:
0
     # 
0
     #   map.resources :articles do |article|
0
     #     article.resources :comments, :name_prefix => nil
0
@@ -364,7 +364,7 @@ module ActionController
0
     #
0
     # See map.resources for general conventions.  These are the main differences:
0
     # * A singular name is given to map.resource.  The default controller name is still taken from the plural name.
0
-    # * To specify a custom plural name, use the :plural option.  There is no :singular option.
0
+    # * To specify a custom plural name, use the <tt>:plural</tt> option.  There is no <tt>:singular</tt> option.
0
     # * No default index route is created for the singleton resource controller.
0
     # * When nesting singleton resources, only the singular name is used as the path prefix (example: 'account/messages/1')
0
     #
...
23
24
25
26
 
 
27
28
29
...
36
37
38
39
40
41
42
43
 
 
 
 
 
44
45
46
...
59
60
61
62
63
64
65
66
67
 
 
 
 
 
 
68
69
70
...
75
76
77
78
79
80
 
 
 
 
81
82
83
...
93
94
95
 
96
97
98
...
138
139
140
141
142
143
144
145
146
 
 
 
 
 
 
 
 
 
147
148
149
150
 
151
152
153
154
155
156
 
 
157
158
159
...
182
183
184
185
 
186
187
188
...
210
211
212
213
 
214
215
216
...
221
222
223
224
225
226
227
 
 
 
 
228
229
230
231
232
233
234
235
236
 
 
 
 
237
238
239
...
241
242
243
244
245
246
247
248
 
 
 
 
 
249
250
251
252
253
 
 
 
 
254
255
256
...
23
24
25
 
26
27
28
29
30
...
37
38
39
 
 
 
 
 
40
41
42
43
44
45
46
47
...
60
61
62
 
 
 
 
 
 
63
64
65
66
67
68
69
70
71
...
76
77
78
 
 
 
79
80
81
82
83
84
85
...
95
96
97
98
99
100
101
...
141
142
143
 
 
 
 
 
 
144
145
146
147
148
149
150
151
152
153
 
 
 
154
155
156
157
158
 
 
159
160
161
162
163
...
186
187
188
 
189
190
191
192
...
214
215
216
 
217
218
219
220
...
225
226
227
 
 
 
 
228
229
230
231
232
233
234
235
236
 
 
 
 
237
238
239
240
241
242
243
...
245
246
247
 
 
 
 
 
248
249
250
251
252
253
 
 
 
 
254
255
256
257
258
259
260
0
@@ -23,7 +23,8 @@ module ActionController
0
   #   map.connect ':controller/:action/:id'
0
   #
0
   # This route states that it expects requests to consist of a
0
-  # :controller followed by an :action that in turn is fed some :id.
0
+  # <tt>:controller</tt> followed by an <tt>:action</tt> that in turn is fed
0
+  # some <tt>:id</tt>.
0
   #
0
   # Suppose you get an incoming request for <tt>/blog/edit/22</tt>, you'll end up
0
   # with:
0
@@ -36,11 +37,11 @@ module ActionController
0
   # Think of creating routes as drawing a map for your requests. The map tells
0
   # them where to go based on some predefined pattern:
0
   #
0
-  #  ActionController::Routing::Routes.draw do |map|
0
-  #   Pattern 1 tells some request to go to one place
0
-  #   Pattern 2 tell them to go to another
0
-  #   ...
0
-  #  end
0
+  #   ActionController::Routing::Routes.draw do |map|
0
+  #     Pattern 1 tells some request to go to one place
0
+  #     Pattern 2 tell them to go to another
0
+  #     ...
0
+  #   end
0
   #
0
   # The following symbols are special:
0
   #
0
@@ -59,12 +60,12 @@ module ActionController
0
   # Within blocks, the empty pattern is at the highest priority.
0
   # In practice this works out nicely:
0
   #
0
-  #  ActionController::Routing::Routes.draw do |map|
0
-  #    map.with_options :controller => 'blog' do |blog|
0
-  #      blog.show '',  :action => 'list'
0
-  #    end
0
-  #    map.connect ':controller/:action/:view'
0
-  #  end
0
+  #   ActionController::Routing::Routes.draw do |map|
0
+  #     map.with_options :controller => 'blog' do |blog|
0
+  #       blog.show '',  :action => 'list'
0
+  #     end
0
+  #     map.connect ':controller/:action/:view'
0
+  #   end
0
   #
0
   # In this case, invoking blog controller (with an URL like '/blog/')
0
   # without parameters will activate the 'list' action by default.
0
@@ -75,9 +76,10 @@ module ActionController
0
   # Hash at the end of your mapping to set any default parameters.
0
   #
0
   # Example:
0
-  #  ActionController::Routing:Routes.draw do |map|
0
-  #    map.connect ':controller/:action/:id', :controller => 'blog'
0
-  #  end
0
+  #
0
+  #   ActionController::Routing:Routes.draw do |map|
0
+  #     map.connect ':controller/:action/:id', :controller => 'blog'
0
+  #   end
0
   #
0
   # This sets up +blog+ as the default controller if no other is specified.
0
   # This means visiting '/' would invoke the blog controller.
0
@@ -93,6 +95,7 @@ module ActionController
0
   # for the full URL and +name_of_route_path+ for the URI path.
0
   #
0
   # Example:
0
+  #
0
   #   # In routes.rb
0
   #   map.login 'login', :controller => 'accounts', :action => 'login'
0
   #
0
@@ -138,22 +141,23 @@ module ActionController
0
   #
0
   # Routes can generate pretty URLs. For example:
0
   #
0
-  #  map.connect 'articles/:year/:month/:day',
0
-  #              :controller => 'articles',
0
-  #              :action     => 'find_by_date',
0
-  #              :year       => /\d{4}/,
0
-  #              :month      => /\d{1,2}/,
0
-  #              :day        => /\d{1,2}/
0
+  #   map.connect 'articles/:year/:month/:day',
0
+  #               :controller => 'articles',
0
+  #               :action     => 'find_by_date',
0
+  #               :year       => /\d{4}/,
0
+  #               :month      => /\d{1,2}/,
0
+  #               :day        => /\d{1,2}/
0
+  #
0
+  # Using the route above, the URL "http://localhost:3000/articles/2005/11/06"
0
+  # maps to
0
   #
0
-  #  # Using the route above, the url below maps to:
0
-  #  # params = {:year => '2005', :month => '11', :day => '06'}
0
-  #  # http://localhost:3000/articles/2005/11/06
0
+  #   params = {:year => '2005', :month => '11', :day => '06'}
0
   #
0
   # == Regular Expressions and parameters
0
   # You can specify a regular expression to define a format for a parameter.
0
   #
0
-  #  map.geocode 'geocode/:postalcode', :controller => 'geocode',
0
-  #              :action => 'show', :postalcode => /\d{5}(-\d{4})?/
0
+  #   map.geocode 'geocode/:postalcode', :controller => 'geocode',
0
+  #               :action => 'show', :postalcode => /\d{5}(-\d{4})?/
0
   #
0
   # or, more formally:
0
   #
0
@@ -182,7 +186,7 @@ module ActionController
0
   #
0
   # Specifying <tt>*[string]</tt> as part of a rule like:
0
   #
0
-  #  map.connect '*path' , :controller => 'blog' , :action => 'unrecognized?'
0
+  #   map.connect '*path' , :controller => 'blog' , :action => 'unrecognized?'
0
   #
0
   # will glob all remaining parts of the route that were not recognized earlier. This idiom
0
   # must appear at the end of the path. The globbed values are in <tt>params[:path]</tt> in
0
@@ -210,7 +214,7 @@ module ActionController
0
   #
0
   # You can reload routes if you feel you must:
0
   #
0
-  #  ActionController::Routing::Routes.reload
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
@@ -221,19 +225,19 @@ module ActionController
0
   #
0
   # === +assert_routing+
0
   #
0
-  #  def test_movie_route_properly_splits
0
-  #   opts = {:controller => "plugin", :action => "checkout", :id => "2"}
0
-  #   assert_routing "plugin/checkout/2", opts
0
-  #  end
0
+  #   def test_movie_route_properly_splits
0
+  #    opts = {:controller => "plugin", :action => "checkout", :id => "2"}
0
+  #    assert_routing "plugin/checkout/2", opts
0
+  #   end
0
   #
0
   # +assert_routing+ lets you test whether or not the route properly resolves into options.
0
   #
0
   # === +assert_recognizes+
0
   #
0
-  #  def test_route_has_options
0
-  #   opts = {:controller => "plugin", :action => "show", :id => "12"}
0
-  #   assert_recognizes opts, "/plugins/show/12"
0
-  #  end
0
+  #   def test_route_has_options
0
+  #    opts = {:controller => "plugin", :action => "show", :id => "12"}
0
+  #    assert_recognizes opts, "/plugins/show/12"
0
+  #   end
0
   #
0
   # Note the subtle difference between the two: +assert_routing+ tests that
0
   # a URL fits options while +assert_recognizes+ tests that a URL
0
@@ -241,16 +245,16 @@ module ActionController
0
   #
0
   # In tests you can simply pass the URL or named route to +get+ or +post+.
0
   #
0
-  #  def send_to_jail
0
-  #    get '/jail'
0
-  #    assert_response :success
0
-  #    assert_template "jail/front"
0
-  #  end
0
+  #   def send_to_jail
0
+  #     get '/jail'
0
+  #     assert_response :success
0
+  #     assert_template "jail/front"
0
+  #   end
0
   #
0
-  #  def goes_to_login
0
-  #    get login_url
0
-  #    #...
0
-  #  end
0
+  #   def goes_to_login
0
+  #     get login_url
0
+  #     #...
0
+  #   end
0
   #
0
   # == View a list of all your routes
0
   #
...
124
125
126
127
 
128
129
130
...
187
188
189
190
 
191
192
193
...
124
125
126
 
127
128
129
130
...
187
188
189
 
190
191
192
193
0
@@ -124,7 +124,7 @@ module ActionController
0
         route_requirements
0
       end
0
 
0
-      # Assign default options, such as 'index' as a default for :action. This
0
+      # Assign default options, such as 'index' as a default for <tt>:action</tt>. This
0
       # method must be run *after* user supplied requirements and defaults have
0
       # been applied to the segments.
0
       def assign_default_route_options(segments)
0
@@ -187,7 +187,7 @@ module ActionController
0
         end
0
 
0
         # Routes cannot use the current string interpolation method
0
-        # if there are user-supplied :requirements as the interpolation
0
+        # if there are user-supplied <tt>:requirements</tt> as the interpolation
0
         # code won't raise RoutingErrors when generating
0
         if options.key?(:requirements) || route.requirements.keys.to_set != Routing::ALLOWED_REQUIREMENTS_FOR_OPTIMISATION
0
           route.optimise = false
...
1
2
3
4
 
5
6
7
8
 
9
10
11
...
41
42
43
44
 
45
46
47
48
49
50
51
52
 
53
54
 
 
 
55
56
 
57
58
59
...
77
78
79
80
 
81
82
83
...
106
107
108
109
 
110
111
112
...
1
2
3
 
4
5
6
7
 
8
9
10
11
...
41
42
43
 
44
45
46
47
48
49
50
 
 
51
52
 
53
54
55
56
 
57
58
59
60
...
78
79
80
 
81
82
83
84
...
107
108
109
 
110
111
112
113
0
@@ -1,11 +1,11 @@
0
 module ActionController
0
   module Routing
0
     # Much of the slow performance from routes comes from the 
0
-    # complexity of expiry, :requirements matching, defaults providing
0
+    # complexity of expiry, <tt>:requirements</tt> matching, defaults providing
0
     # and figuring out which url pattern to use.  With named routes 
0
     # we can avoid the expense of finding the right route.  So if 
0
     # they've provided the right number of arguments, and have no
0
-    # :requirements, we can just build up a string and return it.
0
+    # <tt>:requirements</tt>, we can just build up a string and return it.
0
     # 
0
     # To support building optimisations for other common cases, the 
0
     # generation code is separated into several classes 
0
@@ -41,19 +41,20 @@ module ActionController
0
           end
0
         end
0
 
0
-        # Temporarily disabled :url optimisation pending proper solution to 
0
+        # Temporarily disabled <tt>:url</tt> optimisation pending proper solution to
0
         # Issues around request.host etc.
0
         def applicable?
0
           true
0
         end
0
       end
0
 
0
-      # Given a route:
0
-      # map.person '/people/:id'
0
+      # Given a route
0
       #
0
-      # If the user calls person_url(@person), we can simply
0
+      #   map.person '/people/:id'
0
+      #
0
+      # If the user calls <tt>person_url(@person)</tt>, we can simply
0
       # return a string like "/people/#{@person.to_param}" 
0
-      # rather than triggering the expensive logic in url_for
0
+      # rather than triggering the expensive logic in +url_for+.
0
       class PositionalArguments < Optimiser
0
         def guard_condition
0
           number_of_arguments = route.segment_keys.size
0
@@ -77,7 +78,7 @@ module ActionController
0
 
0
           elements << '#{request.relative_url_root if request.relative_url_root}'
0
 
0
-          # The last entry in route.segments appears to # *always* be a
0
+          # The last entry in <tt>route.segments</tt> appears to *always* be a
0
           # 'divider segment' for '/' but we have assertions to ensure that
0
           # we don't include the trailing slashes, so skip them.
0
           (route.segments.size == 1 ? route.segments : route.segments[0..-2]).each do |segment|
0
@@ -106,7 +107,7 @@ module ActionController
0
           super.insert(-2, '?#{args.last.to_query}')
0
         end
0
 
0
-        # To avoid generating http://localhost/?host=foo.example.com we
0
+        # To avoid generating "http://localhost/?host=foo.example.com" we
0
         # can't use this optimisation on routes without any segments
0
         def applicable?
0
           super && route.segment_keys.size > 0 
...
139
140
141
142
143
 
 
144
145
146
...
139
140
141
 
 
142
143
144
145
146
0
@@ -139,8 +139,8 @@ module ActionController
0
       # those that were not used to generate a particular route. The extra
0
       # keys also do not include those recalled from the prior request, nor
0
       # do they include any keys that were implied in the route (like a
0
-      # :controller that is required, but not explicitly used in the text of
0
-      # the route.)
0
+      # <tt>:controller</tt> that is required, but not explicitly used in the
0
+      # text of the route.)
0
       def extra_keys(hash, recall={})
0
         (hash || {}).keys.map { |k| k.to_sym } - (recall || {}).keys - significant_keys
0
       end
...
14
15
16
17
 
18
19
20
21
22
23
24
25
26
27
28
29
30
 
 
 
 
 
31
32
33
34
 
 
 
 
 
 
35
36
37
 
38
39
40
...
14
15
16
 
17
18
19
20
21
 
 
 
 
 
 
22
 
 
23
24
25
26
27
28
 
 
 
29
30
31
32
33
34
35
36
 
37
38
39
40
0
@@ -14,27 +14,27 @@ require 'openssl'       # to generate the HMAC message digest
0
 # TamperedWithCookie is raised if the data integrity check fails.
0
 #
0
 # A message digest is included with the cookie to ensure data integrity:
0
-# a user cannot alter his user_id without knowing the secret key included in
0
+# a user cannot alter his +user_id+ without knowing the secret key included in
0
 # the hash. New apps are generated with a pregenerated secret in
0
 # config/environment.rb. Set your own for old apps you're upgrading.
0
 #
0
 # Session options:
0
-#   :secret   An application-wide key string or block returning a string
0
-#             called per generated digest. The block is called with the
0
-#             CGI::Session instance as an argument. It's important that the
0
-#             secret is not vulnerable to a dictionary attack. Therefore,
0
-#             you should choose a secret consisting of random numbers and
0
-#             letters and more than 30 characters.
0
 #
0
-#             Example:  :secret => '449fe2e7daee471bffae2fd8dc02313d'
0
-#                       :secret => Proc.new { User.current_user.secret_key }
0
+# * <tt>:secret</tt>: An application-wide key string or block returning a string
0
+#   called per generated digest. The block is called with the CGI::Session
0
+#   instance as an argument. It's important that the secret is not vulnerable to
0
+#   a dictionary attack. Therefore, you should choose a secret consisting of
0
+#   random numbers and letters and more than 30 characters. Examples:
0
 #
0
-#   :digest   The message digest algorithm used to verify session integrity
0
-#             defaults to 'SHA1' but may be any digest provided by OpenSSL,
0
-#             such as 'MD5', 'RIPEMD160', 'SHA256', etc.
0
+#     :secret => '449fe2e7daee471bffae2fd8dc02313d'
0
+#     :secret => Proc.new { User.current_user.secret_key }
0
+#
0
+# * <tt>:digest</tt>: The message digest algorithm used to verify session
0
+#   integrity defaults to 'SHA1' but may be any digest provided by OpenSSL,
0
+#   such as 'MD5', 'RIPEMD160', 'SHA256', etc.
0
 #
0
 # To generate a secret key for an existing application, run
0
-# `rake secret` and set the key in config/environment.rb
0
+# `rake secret` and set the key in config/environment.rb.
0
 #
0
 # Note that changing digest or secret invalidates all existing sessions!
0
 class CGI::Session::CookieStore
...
16
17
18
19
20
21
 
 
 
 
 
22
23
24
...
16
17
18
 
 
 
19
20
21
22
23
24
25
26
0
@@ -16,9 +16,11 @@ module ActionController #:nodoc:
0
     end
0
 
0
     module ClassMethods
0
-      # Set the session store to be used for keeping the session data between requests. By default, sessions are stored
0
-      # in browser cookies (:cookie_store), but you can also specify one of the other included stores
0
-      # (:active_record_store, :p_store, drb_store, :mem_cache_store, or :memory_store) or your own custom class.
0
+      # Set the session store to be used for keeping the session data between requests.
0
+      # By default, sessions are stored in browser cookies (<tt>:cookie_store</tt>),
0
+      # but you can also specify one of the other included stores (<tt>:active_record_store</tt>,
0
+      # <tt>:p_store</tt>, <tt>:drb_store</tt>, <tt>:mem_cache_store</tt>, or
0
+      # <tt>:memory_store</tt>) or your own custom class.
0
       def session_store=(store)
0
         ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] =
0
           store.is_a?(Symbol) ? CGI::Session.const_get(store == :drb_store ? "DRbStore" : store.to_s.camelize) : store
...
17
18
19
20
 
21
22
23
24
25
 
26
27
28
29
30
31
 
 
32
33
34
35
 
36
37
 
38
39
40
...
42
43
44
 
45
46
47
 
48
49
50
 
51
52
53
54
55
 
 
56
57
58
...
95
96
97
98
 
99
100
101
...
103
104
105
 
106
107
108
 
109
110
111
 
112
113
114
...
17
18
19
 
20
21
22
23
24
 
25
26
27
28
29
 
 
30
31
32
33
34
 
35
36
 
37
38
39
40
...
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
 
57
58
59
60
61
...
98
99
100
 
101
102
103
104
...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
0
@@ -17,24 +17,24 @@ module ActionController #:nodoc:
0
       # it feasible to send even large files.
0
       #
0
       # Be careful to sanitize the path parameter if it coming from a web
0
-      # page.  send_file(params[:path]) allows a malicious user to
0
+      # page. <tt>send_file(params[:path])</tt> allows a malicious user to
0
       # download any file on your server.
0
       #
0
       # Options:
0
       # * <tt>:filename</tt> - suggests a filename for the browser to use.
0
-      #   Defaults to File.basename(path).
0
+      #   Defaults to <tt>File.basename(path)</tt>.
0
       # * <tt>:type</tt> - specifies an HTTP content type.
0
       #   Defaults to 'application/octet-stream'.
0
       # * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded.
0
       #   Valid values are 'inline' and 'attachment' (default).
0
-      # * <tt>:stream</tt> - whether to send the file to the user agent as it is read (true)
0
-      #   or to read the entire file before sending (false). Defaults to true.
0
+      # * <tt>:stream</tt> - whether to send the file to the user agent as it is read (+true+)
0
+      #   or to read the entire file before sending (+false+). Defaults to +true+.
0
       # * <tt>:buffer_size</tt> - specifies size (in bytes) of the buffer used to stream the file.
0
       #   Defaults to 4096.
0
       # * <tt>:status</tt> - specifies the status code to send with the response. Defaults to '200 OK'.
0
-      # * <tt>:url_based_filename</tt> - set to true if you want the browser guess the filename from
0
+      # * <tt>:url_based_filename</tt> - set to +true+ if you want the browser guess the filename from
0
       #   the URL, which is necessary for i18n filenames on certain browsers
0
-      #   (setting :filename overrides this option).
0
+      #   (setting <tt>:filename</tt> overrides this option).
0
       #
0
       # The default Content-Type and Content-Disposition headers are
0
       # set to download arbitrary binary files in as many browsers as
0
@@ -42,17 +42,20 @@ module ActionController #:nodoc:
0
       # a variety of quirks (especially when downloading over SSL).
0
       #
0
       # Simple download:
0
+      #
0
       #   send_file '/path/to.zip'
0
       #
0
       # Show a JPEG in the browser:
0
+      #
0
       #   send_file '/path/to.jpeg', :type => 'image/jpeg', :disposition => 'inline'
0
       #
0
       # Show a 404 page in the browser:
0
+      #
0
       #   send_file '/path/to/404.html', :type => 'text/html; charset=utf-8', :status => 404
0
       #
0
       # Read about the other Content-* HTTP headers if you'd like to
0
-      # provide the user with more information (such as Content-Description).
0
-      # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
0
+      # provide the user with more information (such as Content-Description) in
0
+      # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11.
0
       #
0
       # Also be aware that the document may be cached by proxies and browsers.
0
       # The Pragma and Cache-Control headers declare how the file may be cached
0
@@ -95,7 +98,7 @@ module ActionController #:nodoc:
0
       # and specify whether to show data inline or download as an attachment.
0
       #
0
       # Options:
0
-      # * <tt>:filename</tt> - Suggests a filename for the browser to use.
0
+      # * <tt>:filename</tt> - suggests a filename for the browser to use.
0
       # * <tt>:type</tt> - specifies an HTTP content type.
0
       #   Defaults to 'application/octet-stream'.
0
       # * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded.
0
@@ -103,12 +106,15 @@ module ActionController #:nodoc:
0
       # * <tt>:status</tt> - specifies the status code to send with the response. Defaults to '200 OK'.
0
       #
0
       # Generic data download:
0
+      #
0
       #   send_data buffer
0
       #
0
       # Download a dynamically-generated tarball:
0
+      #
0
       #   send_data generate_tgz('dir'), :filename => 'dir.tgz'
0
       #
0
       # Display an image Active Record in the browser:
0
+      #
0
       #   send_data image.data, :type => image.content_type, :disposition => 'inline'
0
       #
0
       # See +send_file+ for more information on HTTP Content-* headers and caching.
...
155
156
157
158
 
159
160
161
162
163
 
164
165
166
...
169
170
171
172
 
173
174
175
176
177
 
178
179
180
181
182
 
183
184
185
186
187
 
188
189
190
191
192
193
194
 
195
196
197
198
199
 
200
201
202
...
205
206
207
208
 
209
210
211
...
217
218
219
220
 
221
222
223
224
225
 
226
227
228
229
230
 
231
232
233
234
235
 
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
263
 
264
265
266
...
465
466
467
468
 
 
469
470
471
 
 
 
472
473
474
...
483
484
485
486
 
487
488
489
490
491
492
493
494
495
496
 
 
 
 
 
 
 
 
 
497
498
499
...
155
156
157
 
158
159
160
161
162
 
163
164
165
166
...
169
170
171
 
172
173
174
175
176
 
177
178
179
180
181
 
182
183
184
185
186
 
187
188
189
190
191
192
193
 
194
195
196
197
198
 
199
200
201
202
...
205
206
207
 
208
209
210
211
...
217
218
219
 
220
221
222
223
224
 
225
226
227
228
229
 
230
231
232
233
234
 
235
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
263
264
265
...
464
465
466
 
467
468
469
470
 
471
472
473
474
475
476
...
485
486
487
 
488
489
 
 
 
 
 
 
 
 
 
490
491
492
493
494
495
496
497
498
499
500
501
0
@@ -155,12 +155,12 @@ module ActionController #:nodoc:
0
   # A refactoring of TestResponse to allow the same behavior to be applied
0
   # to the "real" CgiResponse class in integration tests.
0
   module TestResponseBehavior #:nodoc:
0
-    # the response code of the request
0
+    # The response code of the request
0
     def response_code
0
       headers['Status'][0,3].to_i rescue 0
0
     end
0
     
0
-    # returns a String to ensure compatibility with Net::HTTPResponse
0
+    # Returns a String to ensure compatibility with Net::HTTPResponse
0
     def code
0
       headers['Status'].to_s.split(' ')[0]
0
     end
0
@@ -169,34 +169,34 @@ module ActionController #:nodoc:
0
       headers['Status'].to_s.split(' ',2)[1]
0
     end
0
 
0
-    # was the response successful?
0
+    # Was the response successful?
0
     def success?
0
       response_code == 200
0
     end
0
 
0
-    # was the URL not found?
0
+    # Was the URL not found?
0
     def missing?
0
       response_code == 404
0
     end
0
 
0
-    # were we redirected?
0
+    # Were we redirected?
0
     def redirect?
0
       (300..399).include?(response_code)
0
     end
0
 
0
-    # was there a server-side error?
0
+    # Was there a server-side error?
0
     def error?
0
       (500..599).include?(response_code)
0
     end
0
 
0
     alias_method :server_error?, :error?
0
 
0
-    # returns the redirection location or nil
0
+    # Returns the redirection location or nil
0
     def redirect_url
0
       headers['Location']
0
     end
0
 
0
-    # does the redirect location match this regexp pattern?
0
+    # Does the redirect location match this regexp pattern?
0
     def redirect_url_match?( pattern )
0
       return false if redirect_url.nil?
0
       p = Regexp.new(pattern) if pattern.class == String
0
@@ -205,7 +205,7 @@ module ActionController #:nodoc:
0
       p.match(redirect_url) != nil
0
     end
0
 
0
-    # returns the template path of the file which was used to
0
+    # Returns the template path of the file which was used to
0
     # render this response (or nil) 
0
     def rendered_file(with_controller=false)
0
       unless template.first_render.nil?
0
@@ -217,50 +217,49 @@ module ActionController #:nodoc:
0
       end
0
     end
0
 
0
-    # was this template rendered by a file?
0
+    # Was this template rendered by a file?
0
     def rendered_with_file?
0
       !rendered_file.nil?
0
     end
0
 
0
-    # a shortcut to the flash (or an empty hash if no flash.. hey! that rhymes!)
0
+    # A shortcut to the flash. Returns an empyt hash if no session flash exists.
0
     def flash
0
       session['flash'] || {}
0
     end
0
 
0
-    # do we have a flash? 
0
+    # Do we have a flash?
0
     def has_flash?
0
       !session['flash'].empty?
0
     end
0
 
0
-    # do we have a flash that has contents?
0
+    # Do we have a flash that has contents?
0
     def has_flash_with_contents?
0
       !flash.empty?
0
     end
0
 
0
-    # does the specified flash object exist?
0
+    # Does the specified flash object exist?
0
     def has_flash_object?(name=nil)
0
       !flash[name].nil?
0
     end
0
 
0
-    # does the specified object exist in the session?
0
+    # Does the specified object exist in the session?
0
     def has_session_object?(name=nil)
0
       !session[name].nil?
0
     end
0
 
0
-    # a shortcut to the template.assigns
0
+    # A shortcut to the template.assigns
0
     def template_objects
0
       template.assigns || {}
0
     end
0
 
0
-    # does the specified template object exist? 
0
+    # Does the specified template object exist?
0
     def has_template_object?(name=nil)
0
       !template_objects[name].nil?      
0
     end
0
 
0
     # Returns the response cookies, converted to a Hash of (name => CGI::Cookie) pairs
0
-    # Example:
0
     # 
0
-    # assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
0
+    #   assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
0
     def cookies
0
       headers['cookie'].inject({}) { |hash, cookie| hash[cookie.name] = cookie; hash }
0
     end
0
@@ -465,10 +464,13 @@ module ActionController #:nodoc:
0
       return super
0
     end
0
     
0
-    # Shortcut for ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + path, type). Example:
0
+    # Shortcut for <tt>ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + path, type)</tt>:
0
+    #
0
     #   post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png')
0
     #
0
-    # To upload binary files on Windows, pass :binary as the last parameter. This will not affect other platforms.
0
+    # To upload binary files on Windows, pass <tt>:binary</tt> as the last parameter.
0
+    # This will not affect other platforms:
0
+    #
0
     #   post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png', :binary)
0
     def fixture_file_upload(path, mime_type = nil, binary = false)
0
       ActionController::TestUploadedFile.new(
0
@@ -483,17 +485,17 @@ module ActionController #:nodoc:
0
     # with a new RouteSet instance. 
0
     #
0
     # The new instance is yielded to the passed block. Typically the block
0
-    # will create some routes using map.draw { map.connect ... }:
0
+    # will create some routes using <tt>map.draw { map.connect ... }</tt>:
0
     #
0
-    #  with_routing do |set|
0
-    #    set.draw do |map|
0
-    #      map.connect ':controller/:action/:id'
0
-    #        assert_equal(
0
-    #          ['/content/10/show', {}],
0
-    #          map.generate(:controller => 'content', :id => 10, :action => 'show')
0
-    #      end
0
-    #    end
0
-    #  end
0
+    #   with_routing do |set|
0
+    #     set.draw do |map|
0
+    #       map.connect ':controller/:action/:id'
0
+    #         assert_equal(
0
+    #           ['/content/10/show', {}],
0
+    #           map.generate(:controller => 'content', :id => 10, :action => 'show')
0
+    #       end
0
+    #     end
0
+    #   end
0
     #
0
     def with_routing
0
       real_routes = ActionController::Routing::Routes
...
15
16
17
18
19
 
 
20
21
22
...
29
30
31
32
 
33
34
35
 
 
 
36
37
38
 
 
39
40
41
 
 
42
43
44
...
15
16
17
 
 
18
19
20
21
22
...
29
30
31
 
32
33
 
 
34
35
36
37
38
 
39
40
41
42
 
43
44
45
46
47
0
@@ -15,8 +15,8 @@ module ActionController
0
   # In addition to providing +url_for+, named routes are also accessible after
0
   # including UrlWriter.
0
   module UrlWriter
0
-    # The default options for urls written by this writer. Typically a :host pair
0
-    # is provided.
0
+    # The default options for urls written by this writer. Typically a <tt>:host</tt>
0
+    # pair is provided.
0
     mattr_accessor :default_url_options
0
     self.default_url_options = {}
0
 
0
@@ -29,16 +29,19 @@ module ActionController
0
     # Generate a url based on the options provided, default_url_options and the
0
     # routes defined in routes.rb.  The following options are supported:
0
     #
0
-    # * <tt>:only_path</tt> If true, the relative url is returned. Defaults to false.
0
+    # * <tt>:only_path</tt> If true, the relative url is returned. Defaults to +false+.
0
     # * <tt>:protocol</tt> The protocol to connect to. Defaults to 'http'.
0
-    # * <tt>:host</tt> Specifies the host the link should be targetted at. If <tt>:only_path</tt> is false, this option must be
0
-    #   provided either explicitly, or via default_url_options.
0
+    # * <tt>:host</tt> Specifies the host the link should be targetted at.
0
+    #   If <tt>:only_path</tt> is false, this option must be
0
+    #   provided either explicitly, or via +default_url_options+.
0
     # * <tt>:port</tt> Optionally specify the port to connect to.
0
     # * <tt>:anchor</tt> An anchor name to be appended to the path.
0
-    # * <tt>:skip_relative_url_root</tt> If true, the url is not constructed using the relative_url_root set in <tt>ActionController::AbstractRequest.relative_url_root</tt>.
0
+    # * <tt>:skip_relative_url_root</tt> If true, the url is not constructed using the
0
+    #   +relative_url_root+ set in ActionController::AbstractRequest.relative_url_root.
0
     # * <tt>:trailing_slash</tt> If true, adds a trailing slash, as in "/archive/2009/"
0
     #
0
-    # Any other key(:controller, :action, etc...) given to <tt>url_for</tt> is forwarded to the Routes module.
0
+    # Any other key (<tt>:controller</tt>, <tt>:action</tt>, etc.) given to
0
+    # +url_for+ is forwarded to the Routes module.
0
     #
0
     # Examples:
0
     #
...
287
288
289
290
 
 
291
292
 
293
294
295
...
287
288
289
 
290
291
292
 
293
294
295
296
0
@@ -287,9 +287,10 @@ If you are rendering a subtemplate, you must now use controller-like partial syn
0
       template_path.split('/').last[0,1] != '_'
0
     end
0
 
0
-    # symbolized version of the :format parameter of the request, or :html by default.
0
+    # Returns a symbolized version of the <tt>:format</tt> parameter of the request,
0
+    # or <tt>:html</tt> by default.
0
     #
0
-    # EXCEPTION: If the :format parameter is not set, the Accept header will be examined for
0
+    # EXCEPTION: If the <tt>:format</tt> parameter is not set, the Accept header will be examined for
0
     # whether it contains the JavaScript mime type as its first priority. If that's the case,
0
     # it will be used. This ensures that Ajax applications can use the same URL to support both
0
     # JavaScript and non-JavaScript users.
...
8
9
10
11
 
12
13
14
 
15
16
17
18
19
 
 
 
 
 
20
21
22
23
24
25
 
 
 
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
41
42
 
 
 
 
 
 
 
43
44
45
 
46
47
48
49
50
51
 
 
 
 
 
52
53
54
...
59
60
61
62
63
64
65
66
 
 
 
 
 
67
68
69
...
84
85
86
87
88
 
89
90
91
 
 
92
93
94
 
 
95
96
97
 
 
98
99
100
...
110
111
112
113
114
115
116
117
118
119
 
 
 
 
 
 
 
 
 
 
 
 
 
120
121
 
 
122
123
124
125
126
 
 
127
128
129
130
131
 
 
132
133
134
135
136
 
137
138
139
...
8
9
10
 
11
12
13
 
14
15
 
 
 
 
16
17
18
19
20
21
22
23
24
 
 
25
26
27
28
 
 
 
 
 
 
 
 
 
 
 
 
 
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
45
46
47
48
49
50
51
52
 
 
53
54
 
 
 
 
 
55
56
57
58
59
60
61
62
...
67
68
69
 
 
 
 
 
70
71
72
73
74
75
76
77
...
92
93
94
 
 
95
96
 
 
97
98
99
 
 
100
101
102
 
 
103
104
105
106
107
...
117
118
119
 
 
 
 
 
 
 
120
121
122
123
124
125
126
127
128
129
130
131
132
133
 
134
135
136
137
138
 
 
139
140
141
142
143
 
 
144
145
146
147
148
149
 
150
151
152
153
0
@@ -8,47 +8,55 @@ module ActionView
0
   end
0
 
0
   module Helpers
0
-    # The Active Record Helper makes it easier to create forms for records kept in instance variables. The most far-reaching is the form
0
+    # The Active Record Helper makes it easier to create forms for records kept in instance variables. The most far-reaching is the +form+
0
     # method that creates a complete form for all the basic content types of the record (not associations or aggregations, though). This
0
     # is a great way of making the record quickly available for editing, but likely to prove lackluster for a complicated real-world form.
0
-    # In that case, it's better to use the input method and the specialized form methods in link:classes/ActionView/Helpers/FormHelper.html
0
+    # In that case, it's better to use the +input+ method and the specialized +form+ methods in link:classes/ActionView/Helpers/FormHelper.html
0
     module ActiveRecordHelper
0
-      # Returns a default input tag for the type of object returned by the method. For example, let's say you have a model
0
-      # that has an attribute +title+ of type VARCHAR column, and this instance holds "Hello World":
0
-      #   input("post", "title") =>
0
-      #     <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" />
0
+      # Returns a default input tag for the type of object returned by the method. For example, if <tt>@post</tt>
0
+      # has an attribute +title+ mapped to a +VARCHAR+ column that holds "Hello World":
0
+      #
0
+      #   input("post", "title")
0
+      #   # => <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" />
0
       def input(record_name, method, options = {})
0
         InstanceTag.new(record_name, method, self).to_tag(options)
0
       end
0
 
0
-      # Returns an entire form with all needed input tags for a specified Active Record object. For example, let's say you 
0
-      # have a table model <tt>Post</tt> with attributes named <tt>title</tt> of type <tt>VARCHAR</tt> and <tt>body</tt> of type <tt>TEXT</tt>:
0
+      # Returns an entire form with all needed input tags for a specified Active Record object. For example, if <tt>@post</tt>
0
+      # has attributes named +title+ of type +VARCHAR+ and +body+ of type +TEXT+ then
0
+      #
0
       #   form("post") 
0
-      # That line would yield a form like the following:
0
-      #     <form action='/post/create' method='post'>
0
-      #       <p>
0
-      #         <label for="post_title">Title</label><br />
0
-      #         <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" />
0
-      #       </p>
0
-      #       <p>
0
-      #         <label for="post_body">Body</label><br />
0
-      #         <textarea cols="40" id="post_body" name="post[body]" rows="20">
0
-      #         </textarea>
0
-      #       </p>
0
-      #       <input type='submit' value='Create' />
0
-      #     </form>
0
+      #
0
+      # would yield a form like the following (modulus formatting):
0
+      #
0
+      #   <form action='/posts/create' method='post'>
0
+      #     <p>
0
+      #       <label for="post_title">Title</label><br />
0
+      #       <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" />
0
+      #     </p>
0
+      #     <p>
0
+      #       <label for="post_body">Body</label><br />
0
+      #       <textarea cols="40" id="post_body" name="post[body]" rows="20"></textarea>
0
+      #     </p>
0
+      #     <input name="commit" type="submit" value="Create" />
0
+      #   </form>
0
       #
0
       # It's possible to specialize the form builder by using a different action name and by supplying another
0
-      # block renderer. For example, let's say you have a model <tt>Entry</tt> with an attribute <tt>message</tt> of type <tt>VARCHAR</tt>:
0
+      # block renderer. For example, if <tt>@entry</tt> has an attribute +message+ of type +VARCHAR+ then
0
+      #
0
+      #   form("entry",
0
+      #     :action => "sign",
0
+      #     :input_block => Proc.new { |record, column|
0
+      #       "#{column.human_name}: #{input(record, column.name)}<br />"
0
+      #   })
0
       #
0
-      #   form("entry", :action => "sign", :input_block =>
0
-      #        Proc.new { |record, column| "#{column.human_name}: #{input(record, column.name)}<br />" }) =>
0
+      # would yield a form like the following (modulus formatting):
0
       #
0
-      #     <form action='/post/sign' method='post'>
0
-      #       Message:
0
-      #       <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" /><br />
0
-      #       <input type='submit' value='Sign' />
0
-      #     </form>
0
+      #   <form action="/entries/sign" method="post">
0
+      #     Message:
0
+      #     <input id="entry_message" name="entry[message]" size="30" type="text" /><br />
0
+      #     <input name="commit" type="submit" value="Sign" />
0
+      #   </form>
0
       #
0
       # It's also possible to add additional content to the form by giving it a block, such as:
0
       #
0
@@ -59,11 +67,11 @@ module ActionView
0
       #
0
       # The following options are available:
0
       #
0
-      # * <tt>action</tt> - the action used when submitting the form (default: create if a new record, otherwise update)
0
-      # * <tt>input_block</tt> - specialize the output using a different block, see above
0
-      # * <tt>method</tt> - the method used when submitting the form (default: post)
0
-      # * <tt>multipart</tt> - whether to change the enctype of the form to multipart/form-date, used when uploading a file (default: false)
0
-      # * <tt>submit_value</tt> - the text of the submit button (default: Create if a new record, otherwise Update)
0
+      # * <tt>:action</tt> - The action used when submitting the form (default: +create+ if a new record, otherwise +update+).
0
+      # * <tt>:input_block</tt> - Specialize the output using a different block, see above.
0
+      # * <tt>:method</tt> - The method used when submitting the form (default: +post+).
0
+      # * <tt>:multipart</tt> - Whether to change the enctype of the form to "multipart/form-data", used when uploading a file (default: +false+).
0
+      # * <tt>:submit_value</tt> - The text of the submit button (default: "Create" if a new record, otherwise "Update").
0
       def form(record_name, options = {})
0
         record = instance_variable_get("@#{record_name}")
0
 
0
@@ -84,17 +92,16 @@ module ActionView
0
       # Returns a string containing the error message attached to the +method+ on the +object+ if one exists.
0
       # This error message is wrapped in a <tt>DIV</tt> tag, which can be extended to include a +prepend_text+ and/or +append_text+
0
       # (to properly explain the error), and a +css_class+ to style it accordingly. +object+ should either be the name of an instance variable or
0
-      # the actual object. As an example, let's say you have a model
0
-      # +post+ that has an error message on the +title+ attribute:
0
+      # the actual object. As an example, let's say you have a model <tt>@post</tt> that has an error message on the +title+ attribute:
0
       #
0
-      #   <%= error_message_on "post", "title" %> =>
0
-      #     <div class="formError">can't be empty</div>
0
+      #   <%= error_message_on "post", "title" %>
0
+      #   # => <div class="formError">can't be empty</div>
0
       #
0
-      #   <%= error_message_on @post, "title" %> =>
0
-      #     <div class="formError">can't be empty</div>
0
+      #   <%= error_message_on @post, "title" %>
0
+      #   # => <div class="formError">can't be empty</div>
0
       #
0
-      #   <%= error_message_on "post", "title", "Title simply ", " (or it won't work).", "inputError" %> =>
0
-      #     <div class="inputError">Title simply can't be empty (or it won't work).</div>
0
+      #   <%= error_message_on "post", "title", "Title simply ", " (or it won't work).", "inputError" %>
0
+      #   # => <div class="inputError">Title simply can't be empty (or it won't work).</div>
0
       def error_message_on(object, method, prepend_text = "", append_text = "", css_class = "formError")
0
         if (obj = (object.respond_to?(:errors) ? object : instance_variable_get("@#{object}"))) &&
0
           (errors = obj.errors.on(method))
0
@@ -110,30 +117,37 @@ module ActionView
0
       #
0
       # This <tt>DIV</tt> can be tailored by the following options:
0
       #
0
-      # * <tt>header_tag</tt> - Used for the header of the error div (default: h2)
0
-      # * <tt>id</tt> - The id of the error div (default: errorExplanation)
0
-      # * <tt>class</tt> - The class of the error div (default: errorExplanation)
0
-      # * <tt>object</tt> - The object (or array of objects) for which to display errors, if you need to escape the instance variable convention
0
-      # * <tt>object_name</tt> - The object name to use in the header, or any text that you prefer. If <tt>object_name</tt> is not set, the name of the first object will be used.
0
-      # * <tt>header_message</tt> - The message in the header of the error div.  Pass +nil+ or an empty string to avoid the header message altogether. (default: X errors prohibited this object from being saved)
0
-      # * <tt>message</tt> - The explanation message after the header message and before the error list.  Pass +nil+ or an empty string to avoid the explanation message altogether.  (default: There were problems with the following fields:)
0
+      # * <tt>:header_tag</tt> - Used for the header of the error div (default: "h2").
0
+      # * <tt>:id</tt> - The id of the error div (default: "errorExplanation").
0
+      # * <tt>:class</tt> - The class of the error div (default: "errorExplanation").
0
+      # * <tt>:object</tt> - The object (or array of objects) for which to display errors,
0
+      #   if you need to escape the instance variable convention.
0
+      # * <tt>:object_name</tt> - The object name to use in the header, or any text that you prefer.
0
+      #   If <tt>:object_name</tt> is not set, the name of the first object will be used.
0
+      # * <tt>:header_message</tt> - The message in the header of the error div.  Pass +nil+
0
+      #   or an empty string to avoid the header message altogether. (Default: "X errors
0
+      #   prohibited this object from being saved").
0
+      # * <tt>:message</tt> - The explanation message after the header message and before
0
+      #   the error list.  Pass +nil+ or an empty string to avoid the explanation message
0
+      #   altogether. (Default: "There were problems with the following fields:").
0
       #
0
-      # To specify the display for one object, you simply provide its name as a parameter.  For example, for the +User+ model:
0
+      # To specify the display for one object, you simply provide its name as a parameter.
0
+      # For example, for the <tt>@user</tt> model:
0
       # 
0
       #   error_messages_for 'user'
0
       #
0
-      # To specify more than one object, you simply list them; optionally, you can add an extra +object_name+ parameter, which
0
-      # will be the name used in the header message.
0
+      # To specify more than one object, you simply list them; optionally, you can add an extra <tt>:object_name</tt> parameter, which
0
+      # will be the name used in the header message:
0
       #
0
       #   error_messages_for 'user_common', 'user', :object_name => 'user'
0
       #
0
-      # If the objects cannot be located as instance variables, you can add an extra +object+ paremeter which gives the actual
0
-      # object (or array of objects to use)
0
+      # If the objects cannot be located as instance variables, you can add an extra <tt>:object</tt> paremeter which gives the actual
0
+      # object (or array of objects to use):
0
       #
0
       #   error_messages_for 'user', :object => @question.user
0
       #
0
       # NOTE: This is a pre-packaged presentation of the errors with embedded strings and a certain HTML structure. If what
0
-      # you need is significantly different from the default presentation, it makes plenty of sense to access the object.errors
0
+      # you need is significantly different from the default presentation, it makes plenty of sense to access the <tt>object.errors</tt>
0
       # instance yourself and set it up. View the source of this method to see how easy it is.
0
       def error_messages_for(*params)
0
         options = params.extract_options!.symbolize_keys
...
164
165
166
167
 
168
169
170
...
332
333
334
335
 
336
337
338
...
164
165
166
 
167
168
169
170
...
332
333
334
 
335
336
337
338
0
@@ -164,7 +164,7 @@ module ActionView
0
       # current page or you can pass the full path relative to your document
0
       # root. To include the Prototype and Scriptaculous javascript libraries in
0
       # your application, pass <tt>:defaults</tt> as the source. When using
0
-      # :defaults, if an <tt>application.js</tt> file exists in your public
0
+      # <tt>:defaults</tt>, if an application.js file exists in your public
0
       # javascripts directory, it will be included as well. You can modify the
0
       # html attributes of the script tag by passing a hash as the last argument.
0
       #
0
@@ -332,7 +332,7 @@ module ActionView
0
       #     <link href="/stylesheets/random.styles" media="screen" rel="stylesheet" type="text/css" />
0
       #     <link href="/css/stylish.css" media="screen" rel="stylesheet" type="text/css" />
0
       #
0
-      # You can also include all styles in the stylesheet directory using :all as the source:
0
+      # You can also include all styles in the stylesheet directory using <tt>:all</tt> as the source:
0
       #
0
       #   stylesheet_link_tag :all # =>
0
       #     <link href="/stylesheets/style1.css"  media="screen" rel="stylesheet" type="text/css" />
...
104
105
106
107
 
108
109
110
111
112
113
 
114
115
 
116
117
 
118
119
120
...
104
105
106
 
107
108
109
110
111
112
 
113
114
 
115
116
 
117
118
119
120
0
@@ -104,17 +104,17 @@ module ActionView
0
 
0
       # Returns a set of select tags (one for year, month, and day) pre-selected for accessing a specified date-based attribute (identified by
0
       # +method+) on an object assigned to the template (identified by +object+). It's possible to tailor the selects through the +options+ hash,
0
-      # which accepts all the keys that each of the individual select builders do (like :use_month_numbers for select_month) as well as a range of
0
+      # which accepts all the keys that each of the individual select builders do (like <tt>:use_month_numbers</tt> for select_month) as well as a range of
0
       # discard options. The discard options are <tt>:discard_year</tt>, <tt>:discard_month</tt> and <tt>:discard_day</tt>. Set to true, they'll
0
       # drop the respective select. Discarding the month select will also automatically discard the day select. It's also possible to explicitly
0
       # set the order of the tags using the <tt>:order</tt> option with an array of symbols <tt>:year</tt>, <tt>:month</tt> and <tt>:day</tt> in
0
       # the desired order. Symbols may be omitted and the respective select is not included.
0
       #
0
-      # Pass the <tt>:default</tt> option to set the default date. Use a Time object or a Hash of :year, :month, :day, :hour, :minute, and :second.
0
+      # Pass the <tt>:default</tt> option to set the default date. Use a Time object or a Hash of <tt>:year</tt>, <tt>:month</tt>, <tt>:day</tt>, <tt>:hour</tt>, <tt>:minute</tt>, and <tt>:second</tt>.
0
       #
0
-      # Passing :disabled => true as part of the +options+ will make elements inaccessible for change.
0
+      # Passing <tt>:disabled => true</tt> as part of the +options+ will make elements inaccessible for change.
0
       #
0
-      # If anything is passed in the html_options hash it will be applied to every select tag in the set.
0
+      # If anything is passed in the +html_options+ hash it will be applied to every select tag in the set.
0
       #
0
       # NOTE: Discarded selects will default to 1. So if no month select is available, January will be assumed.
0
       #
...
108
109
110
111
 
112
113
114
...
108
109
110
 
111
112
113
114
0
@@ -108,7 +108,7 @@ module ActionView
0
       # Note: This also works for the methods in FormOptionHelper and DateHelper that are designed to work with an object as base,
0
       # like FormOptionHelper#collection_select and DateHelper#datetime_select.
0
       #
0
-      # HTML attributes for the form tag can be given as :html => {...}. For example:
0
+      # HTML attributes for the form tag can be given as <tt>:html => {...}</tt>. For example:
0
       #
0
       #   <% form_for :person, @person, :html => {:id => 'person_form'} do |f| %>
0
       #     ...
...
93
94
95
96
97
 
 
98
99
100
...
93
94
95
 
 
96
97
98
99
100
0
@@ -93,8 +93,8 @@ module ActionView
0
       # This allows the user to submit a form page more than once with the expected results of creating multiple records.
0
       # In addition, this allows a single partial to be used to generate form inputs for both edit and create forms.
0
       #
0
-      # By default, post.person_id is the selected option.  Specify :selected => value to use a different selection
0
-      # or :selected => nil to leave all options unselected.
0
+      # By default, <tt>post.person_id</tt> is the selected option.  Specify <tt>:selected => value</tt> to use a different selection
0
+      # or <tt>:selected => nil</tt> to leave all options unselected.
0
       def select(object, method, choices, options = {}, html_options = {})
0
         InstanceTag.new(object, method, self, nil, options.delete(:object)).to_select_tag(choices, options, html_options)
0
       end
...
341
342
343
344
345
 
 
 
346
347
348
...
341
342
343
 
 
344
345
346
347
348
349
0
@@ -341,8 +341,9 @@ module ActionView
0
       #   submit_tag nil, :class => "form_submit"
0
       #   # => <input class="form_submit" name="commit" type="submit" />
0
       #
0
-      #   submit_tag "Edit", :disable_with => "Editing...", :class => 'edit-button'
0
-      #   # => <input class="edit-button" disable_with="Editing..." name="commit" type="submit" value="Edit" />
0
+      #   submit_tag "Edit", :disable_with => "Editing...", :class => "edit-button"
0
+      #   # => <input class="edit-button" onclick="this.disabled=true;this.value='Editing...';this.form.submit();"
0
+      #   #    name="commit" type="submit" value="Edit" />
0
       def submit_tag(value = "Save changes", options = {})
0
         options.stringify_keys!
0
         
...
255
256
257
258
 
259
260
261
 
 
262
263
264
...
291
292
293
294
295
 
 
296
297
298
 
299
300
301
...
304
305
306
307
 
308
309
310
311
 
312
313
314
...
422
423
424
425
426
 
 
427
428
429
...
255
256
257
 
258
259
 
 
260
261
262
263
264
...
291
292
293
 
 
294
295
296
297
 
298
299
300
301
...
304
305
306
 
307
308
309
310
 
311
312
313
314
...
422
423
424
 
 
425
426
427
428
429
0
@@ -255,10 +255,10 @@ module ActionView
0
         link_to_function(name, remote_function(options), html_options || options.delete(:html))
0
       end
0
 
0
-      # Periodically calls the specified url (<tt>options[:url]</tt>) every 
0
+      # Periodically calls the specified url (<tt>options[:url]</tt>) every
0
       # <tt>options[:frequency]</tt> seconds (default is 10). Usually used to
0
-      # update a specified div (<tt>options[:update]</tt>) with the results 
0
-      # of the remote call. The options for specifying the target with :url 
0
+      # update a specified div (<tt>options[:update]</tt>) with the results
0
+      # of the remote call. The options for specifying the target with <tt>:url</tt>
0
       # and defining callbacks is the same as link_to_remote.
0
       # Examples:
0
       #  # Call get_averages and put its results in 'avg' every 10 seconds
0
@@ -291,11 +291,11 @@ module ActionView
0
       # though it's using JavaScript to serialize the form elements, the form
0
       # submission will work just like a regular submission as viewed by the
0
       # receiving side (all elements available in <tt>params</tt>). The options for 
0
-      # specifying the target with :url and defining callbacks is the same as
0
-      # link_to_remote.
0
+      # specifying the target with <tt>:url</tt> and defining callbacks is the same as
0
+      # +link_to_remote+.
0
       #
0
       # A "fall-through" target for browsers that doesn't do JavaScript can be
0
-      # specified with the :action/:method options on :html.
0
+      # specified with the <tt>:action</tt>/<tt>:method</tt> options on <tt>:html</tt>.
0
       #
0
       # Example:
0
       #   # Generates:
0
@@ -304,11 +304,11 @@ module ActionView
0
       #   form_remote_tag :html => { :action => 
0
       #     url_for(:controller => "some", :action => "place") }
0
       #
0
-      # The Hash passed to the :html key is equivalent to the options (2nd) 
0
+      # The Hash passed to the <tt>:html</tt> key is equivalent to the options (2nd)
0
       # argument in the FormTagHelper.form_tag method.
0
       #
0
       # By default the fall-through action is the same as the one specified in 
0
-      # the :url (and the default method is :post).
0
+      # the <tt>:url</tt> (and the default method is <tt>:post</tt>).
0
       #
0
       # form_remote_tag also takes a block, like form_tag:
0
       #   # Generates:
0
@@ -422,8 +422,8 @@ module ActionView
0
       end
0
       
0
       # Returns '<tt>eval(request.responseText)</tt>' which is the JavaScript function
0
-      # that form_remote_tag can call in :complete to evaluate a multiple
0
-      # update return document using update_element_function calls.
0
+      # that +form_remote_tag+ can call in <tt>:complete</tt> to evaluate a multiple
0
+      # update return document using +update_element_function+ calls.
0
       def evaluate_remote_response
0
         "eval(request.responseText)"
0
       end
...
10
11
12
13
 
14
15
16
...
18
19
20
21
 
22
23
24
...
10
11
12
 
13
14
15
16
...
18
19
20
 
21
22
23
24
0
@@ -10,7 +10,7 @@ module ActionView
0
         base.extend(ClassMethods)
0
       end
0
       
0
-      # This #sanitize helper will html encode all tags and strip all attributes that aren't specifically allowed.  
0
+      # This +sanitize+ helper will html encode all tags and strip all attributes that aren't specifically allowed.
0
       # It also strips href/src tags with invalid protocols, like javascript: especially.  It does its best to counter any
0
       # tricks that hackers may use, like throwing in unicode/ascii/hex values to get past the javascript: filters.  Check out
0
       # the extensive test suite.
0
@@ -18,7 +18,7 @@ module ActionView
0
       #   <%= sanitize @article.body %>
0
       # 
0
       # You can add or remove tags/attributes if you want to customize it a bit.  See ActionView::Base for full docs on the
0
-      # available options.  You can add tags/attributes for single uses of #sanitize by passing either the :attributes or :tags options:
0
+      # available options.  You can add tags/attributes for single uses of +sanitize+ by passing either the <tt>:attributes</tt> or <tt>:tags</tt> options:
0
       #
0
       # Normal Use
0
       #
...
35
36
37
38
39
 
 
40
41
42
...
35
36
37
 
 
38
39
40
41
42
0
@@ -35,8 +35,8 @@ module ActionView
0
       # This would fade the element that was dropped on the drop receiving 
0
       # element.
0
       #
0
-      # For toggling visual effects, you can use :toggle_appear, :toggle_slide, and
0
-      # :toggle_blind which will alternate between appear/fade, slidedown/slideup, and
0
+      # For toggling visual effects, you can use <tt>:toggle_appear</tt>, <tt>:toggle_slide</tt>, and
0
+      # <tt>:toggle_blind</tt> which will alternate between appear/fade, slidedown/slideup, and
0
       # blinddown/blindup respectively.
0
       #
0
       # You can change the behaviour with various options, see
...
16
17
18
19
 
20
21
22
...
25
26
27
28
29
 
 
30
31
32
...
102
103
104
105
 
106
107
108
109
 
110
111
112
113
 
114
115
116
 
117
118
119
 
120
121
122
...
16
17
18
 
19
20
21
22
...
25
26
27
 
 
28
29
30
31
32
...
102
103
104
 
105
106
107
108
 
109
110
111
112
 
113
114
115
 
116
117
118
 
119
120
121
122
0
@@ -16,7 +16,7 @@ module ActionView
0
       # instead of the fully qualified URL like http://example.com/controller/action.
0
       #
0
       # When called from a view, url_for returns an HTML escaped url. If you
0
-      # need an unescaped url, pass :escape => false in the +options+.
0
+      # need an unescaped url, pass <tt>:escape => false</tt> in the +options+.
0
       #
0
       # ==== Options
0
       # * <tt>:anchor</tt> -- specifies the anchor name to be appended to the path.
0
@@ -25,8 +25,8 @@ module ActionView
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>:user</tt> -- Inline HTTP authentication (only plucked out if :password is also present)
0
-      # * <tt>:password</tt> -- Inline HTTP authentication (only plucked out if :user is also present)
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>:escape</tt> -- Determines whether the returned URL will be HTML escaped or not (<tt>true</tt> by default)
0
       #
0
       # ==== Relying on named routes
0
@@ -102,21 +102,21 @@ module ActionView
0
       #   create an HTML form and immediately submit the form for processing using
0
       #   the HTTP verb specified. Useful for having links perform a POST operation
0
       #   in dangerous actions like deleting a record (which search bots can follow
0
-      #   while spidering your site). Supported verbs are :post, :delete and :put.
0
+      #   while spidering your site). Supported verbs are <tt>:post</tt>, <tt>:delete</tt> and <tt>:put</tt>.
0
       #   Note that if the user has JavaScript disabled, the request will fall back
0
       #   to using GET. If you are relying on the POST behavior, you should check
0
       #   for it in your controller's action by using the request object's methods
0
-      #   for post?, delete? or put?.
0
+      #   for <tt>post?</tt>, <tt>delete?</tt> or <tt>put?</tt>.
0
       # * The +html_options+ will accept a hash of html attributes for the link tag.
0
       #
0
       # Note that if the user has JavaScript disabled, the request will fall back
0
-      # to using GET. If :href=>'#' is used and the user has JavaScript disabled
0
+      # to using GET. If <tt>:href => '#'</tt> is used and the user has JavaScript disabled
0
       # clicking the link will have no effect. If you are relying on the POST 
0
       # behavior, your should check for it in your controller's action by using the 
0
-      # request object's methods for post?, delete? or put?. 
0
+      # request object's methods for <tt>post?</tt>, <tt>delete?</tt> or <tt>put?</tt>.
0
       #
0
       # You can mix and match the +html_options+ with the exception of
0
-      # :popup and :method which will raise an ActionView::ActionViewError
0
+      # <tt>:popup</tt> and <tt>:method</tt> which will raise an ActionView::ActionViewError
0
       # exception.
0
       #
0
       # ==== Examples
...
100
101
102
103
 
104
105
106
...
100
101
102
 
103
104
105
106
0
@@ -100,7 +100,7 @@ module ActionView
0
   #     Title: <%= chief.name %>
0
   #   </div>
0
   #
0
-  # As you can see, the :locals hash is shared between both the partial and its layout.
0
+  # As you can see, the <tt>:locals</tt> hash is shared between both the partial and its layout.
0
   module Partials
0
     private
0
       def render_partial(partial_path, object_assigns = nil, local_assigns = {}) #:nodoc:
...
10
11
12
13
 
14
15
16
...
35
36
37
38
39
 
 
40
41
42
...
46
47
48
49
50
51
52
53
 
 
 
 
 
54
55
56
 
 
57
58
59
...
10
11
12
 
13
14
15
16
...
35
36
37
 
 
38
39
40
41
42
...
46
47
48
 
 
 
 
 
49
50
51
52
53
54
 
 
55
56
57
58
59
0
@@ -10,7 +10,7 @@ module ActiveModel
0
       DEFAULT_VALIDATION_OPTIONS = { :on => :save, :allow_nil => false, :allow_blank => false, :message => nil }.freeze
0
 
0
       # Adds a validation method or block to the class. This is useful when
0
-      # overriding the #validate instance method becomes too unwieldly and
0
+      # overriding the +validate+ instance method becomes too unwieldly and
0
       # you're looking for more descriptive declaration of your validations.
0
       #
0
       # This can be done with a symbol pointing to a method:
0
@@ -35,8 +35,8 @@ module ActiveModel
0
       #     end
0
       #   end
0
       #
0
-      # This usage applies to #validate_on_create and #validate_on_update as well.
0
-
0
+      # This usage applies to +validate_on_create+ and +validate_on_update as well+.
0
+      #
0
       # Validates each attribute against a block.
0
       #
0
       #   class Person < ActiveRecord::Base
0
@@ -46,14 +46,14 @@ module ActiveModel
0
       #   end
0
       #
0
       # Options:
0
-      # * <tt>on</tt> - Specifies when this validation is active (default is :save, other options :create, :update)
0
-      # * <tt>allow_nil</tt> - Skip validation if attribute is nil.
0
-      # * <tt>allow_blank</tt> - Skip validation if attribute is blank.
0
-      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
0
+      # * <tt>:on</tt> - Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>)
0
+      # * <tt>:allow_nil</tt> - Skip validation if attribute is +nil+.
0
+      # * <tt>:allow_blank</tt> - Skip validation if attribute is blank.
0
+      # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
-      # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
0
+      # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
       def validates_each(*attrs)
0
         options = attrs.extract_options!.symbolize_keys
...
8
9
10
11
12
 
 
13
14
15
16
17
18
19
20
21
22
 
 
 
 
 
 
 
 
 
 
 
23
24
25
26
27
28
29
...
8
9
10
 
 
11
12
13
14
 
 
 
 
 
 
 
 
15
16
17
18
19
20
21
22
23
24
25
26
 
 
 
27
28
29
0
@@ -8,22 +8,22 @@ module ActiveModel
0
       #     validates_acceptance_of :eula, :message => "must be abided"
0
       #   end
0
       #
0
-      # If the database column does not exist, the terms_of_service attribute is entirely virtual. This check is
0
-      # performed only if terms_of_service is not nil and by default on save.
0
+      # If the database column does not exist, the <tt>:terms_of_service</tt> attribute is entirely virtual. This check is
0
+      # performed only if <tt>:terms_of_service</tt> is not +nil+ and by default on save.
0
       #
0
       # Configuration options:
0
-      # * <tt>message</tt> - A custom error message (default is: "must be accepted")
0
-      # * <tt>on</tt> - Specifies when this validation is active (default is :save, other options :create, :update)
0
-      # * <tt>allow_nil</tt> - Skip validation if attribute is nil. (default is true)
0
-      # * <tt>accept</tt> - Specifies value that is considered accepted.  The default value is a string "1", which
0
-      #   makes it easy to relate to an HTML checkbox. This should be set to 'true' if you are validating a database
0
-      #   column, since the attribute is typecast from "1" to <tt>true</tt> before validation.
0
-      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
0
+      # * <tt>:message</tt> - A custom error message (default is: "must be accepted")
0
+      # * <tt>:on</tt> - Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>)
0
+      # * <tt>:allow_nil</tt> - Skip validation if attribute is +nil+. (default is +true+)
0
+      # * <tt>:accept</tt> - Specifies value that is considered accepted.  The default value is a string "1", which
0
+      #   makes it easy to relate to an HTML checkbox. This should be set to +true+ if you are validating a database
0
+      #   column, since the attribute is typecasted from "1" to +true+ before validation.
0
+      # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
0
+      #   method, proc or string should return or evaluate to a true or false value.
0
+      # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
-      # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
0
-      #   method, proc or string should return or evaluate to a true or false value.      
0
       def validates_acceptance_of(*attr_names)
0
         configuration = { :message => ActiveRecord::Errors.default_error_messages[:accepted], :on => :save, :allow_nil => true, :accept => "1" }
0
         configuration.update(attr_names.extract_options!)
...
21
22
23
24
 
25
26
27
28
29
30
 
 
 
 
31
32
33
 
 
34
35
36
...
21
22
23
 
24
25
26
 
 
 
 
27
28
29
30
31
 
 
32
33
34
35
36
0
@@ -21,16 +21,16 @@ module ActiveModel
0
       # ...this would specify a circular dependency and cause infinite recursion.
0
       #
0
       # NOTE: This validation will not fail if the association hasn't been assigned. If you want to ensure that the association
0
-      # is both present and guaranteed to be valid, you also need to use validates_presence_of.
0
+      # is both present and guaranteed to be valid, you also need to use +validates_presence_of+.
0
       #
0
       # Configuration options:
0
-      # * <tt>message</tt> - A custom error message (default is: "is invalid")
0
-      # * <tt>on</tt> Specifies when this validation is active (default is :save, other options :create, :update)
0
-      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
0
+      # * <tt>:message</tt> - A custom error message (default is: "is invalid")
0
+      # * <tt>:on</tt> Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>)
0
+      # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
-      # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
0
+      # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
       def validates_associated(*attr_names)
0
         configuration = { :message => ActiveRecord::Errors.default_error_messages[:invalid], :on => :save }
...
15
16
17
18
 
19
20
21
22
23
24
25
26
27
 
 
 
 
 
 
 
28
29
30
31
32
33
34
...
15
16
17
 
18
19
20
21
22
23
 
 
 
 
24
25
26
27
28
29
30
31
 
 
 
32
33
34
0
@@ -15,20 +15,20 @@ module ActiveModel
0
       #
0
       # The added +password_confirmation+ attribute is virtual; it exists only as an in-memory attribute for validating the password.
0
       # To achieve this, the validation adds accessors to the model for the confirmation attribute. NOTE: This check is performed
0
-      # only if +password_confirmation+ is not nil, and by default only on save. To require confirmation, make sure to add a presence
0
+      # only if +password_confirmation+ is not +nil+, and by default only on save. To require confirmation, make sure to add a presence
0
       # check for the confirmation attribute:
0
       #
0
       #   validates_presence_of :password_confirmation, :if => :password_changed?
0
       #
0
       # Configuration options:
0
-      # * <tt>message</tt> - A custom error message (default is: "doesn't match confirmation")
0
-      # * <tt>on</tt> - Specifies when this validation is active (default is :save, other options :create, :update)
0
-      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
0
+      # * <tt>:message</tt> - A custom error message (default is: "doesn't match confirmation")
0
+      # * <tt>:on</tt> - Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>)
0
+      # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
0
+      #   method, proc or string should return or evaluate to a true or false value.
0
+      # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
-      # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
0
-      #   method, proc or string should return or evaluate to a true or false value.      
0
       def validates_confirmation_of(*attr_names)
0
         configuration = { :message => ActiveRecord::Errors.default_error_messages[:confirmation], :on => :save }
0
         configuration.update(attr_names.extract_options!)
...
10
11
12
13
14
15
16
17
18
 
 
 
 
 
 
19
20
21
 
 
22
23
24
...
10
11
12
 
 
 
 
 
 
13
14
15
16
17
18
19
 
 
20
21
22
23
24
0
@@ -10,15 +10,15 @@ module ActiveModel
0
       #   end
0
       #
0
       # Configuration options:
0
-      # * <tt>in</tt> - An enumerable object of items that the value shouldn't be part of
0
-      # * <tt>message</tt> - Specifies a custom error message (default is: "is reserved")
0
-      # * <tt>allow_nil</tt> - If set to true, skips this validation if the attribute is null (default is: false)
0
-      # * <tt>allow_blank</tt> - If set to true, skips this validation if the attribute is blank (default is: false)
0
-      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
0
+      # * <tt>:in</tt> - An enumerable object of items that the value shouldn't be part of
0
+      # * <tt>:message</tt> - Specifies a custom error message (default is: "is reserved")
0
+      # * <tt>:allow_nil</tt> - If set to +true+, skips this validation if the attribute is +nil+ (default is: +false+)
0
+      # * <tt>:allow_blank</tt> - If set to +true+, skips this validation if the attribute is blank (default is: +false+)
0
+      # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
-      # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
0
+      # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
       def validates_exclusion_of(*attr_names)
0
         configuration = { :message => ActiveRecord::Errors.default_error_messages[:exclusion], :on => :save }
...
8
9
10
11
 
12
13
14
15
16
17
18
19
20
21
22
 
 
 
 
 
 
 
23
24
25
 
 
26
27
28
...
8
9
10
 
11
12
13
14
15
 
 
 
 
 
 
 
16
17
18
19
20
21
22
23
 
 
24
25
26
27
28
0
@@ -8,21 +8,21 @@ module ActiveModel
0
       #     validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :on => :create
0
       #   end
0
       #
0
-      # Note: use \A and \Z to match the start and end of the string, ^ and $ match the start/end of a line.
0
+      # Note: use <tt>\A</tt> and <tt>\Z</tt> to match the start and end of the string, <tt>^</tt> and <tt>$</tt> match the start/end of a line.
0
       #
0
       # A regular expression must be provided or else an exception will be raised.
0
       #
0
       # Configuration options:
0
-      # * <tt>message</tt> - A custom error message (default is: "is invalid")
0
-      # * <tt>allow_nil</tt> - If set to true, skips this validation if the attribute is null (default is: false)
0
-      # * <tt>allow_blank</tt> - If set to true, skips this validation if the attribute is blank (default is: false)
0
-      # * <tt>with</tt> - The regular expression used to validate the format with (note: must be supplied!)
0
-      # * <tt>on</tt> Specifies when this validation is active (default is :save, other options :create, :update)
0
-      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
0
+      # * <tt>:message</tt> - A custom error message (default is: "is invalid")
0
+      # * <tt>:allow_nil</tt> - If set to +true+, skips this validation if the attribute is +nil+ (default is: +false+)
0
+      # * <tt>:allow_blank</tt> - If set to +true+, skips this validation if the attribute is blank (default is: +false+)
0
+      # * <tt>:with</tt> - The regular expression used to validate the format with (note: must be supplied!)
0
+      # * <tt>:on</tt> - Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>)
0
+      # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
-      # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
0
+      # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
       def validates_format_of(*attr_names)
0
         configuration = { :message => ActiveRecord::Errors.default_error_messages[:invalid], :on => :save, :with => nil }
...
10
11
12
13
14
15
16
17
18
 
 
 
 
 
 
19
20
21
 
 
22
23
24
...
10
11
12
 
 
 
 
 
 
13
14
15
16
17
18
19
 
 
20
21
22
23
24
0
@@ -10,15 +10,15 @@ module ActiveModel
0
       #   end
0
       #
0
       # Configuration options:
0
-      # * <tt>in</tt> - An enumerable object of available items
0
-      # * <tt>message</tt> - Specifies a custom error message (default is: "is not included in the list")
0
-      # * <tt>allow_nil</tt> - If set to true, skips this validation if the attribute is null (default is: false)
0
-      # * <tt>allow_blank</tt> - If set to true, skips this validation if the attribute is blank (default is: false)
0
-      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
0
+      # * <tt>:in</tt> - An enumerable object of available items
0
+      # * <tt>:message</tt> - Specifies a custom error message (default is: "is not included in the list")
0
+      # * <tt>:allow_nil</tt> - If set to +true+, skips this validation if the attribute is null (default is: +false+)
0
+      # * <tt>:allow_blank</tt> - If set to +true+, skips this validation if the attribute is blank (default is: +false+)
0
+      # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
-      # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
0
+      # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
       def validates_inclusion_of(*attr_names)
0
         configuration = { :message => ActiveRecord::Errors.default_error_messages[:inclusion], :on => :save }
...
6
7
8
9
10
 
 
11
12
13
14
15
 
 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
35
36
37
38
39
40
...
6
7
8
 
 
9
10
11
12
13
 
 
14
15
16
17
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
 
 
37
38
39
0
@@ -6,35 +6,34 @@ module ActiveModel
0
       # Validates that the specified attribute matches the length restrictions supplied. Only one option can be used at a time:
0
       #
0
       #   class Person < ActiveRecord::Base
0
-      #     validates_length_of :first_name, :maximum=>30
0
-      #     validates_length_of :last_name, :maximum=>30, :message=>"less than %d if you don't mind"
0
+      #     validates_length_of :first_name, :maximum => 30
0
+      #     validates_length_of :last_name, :maximum => 30, :message => "less than %d if you don't mind"
0
       #     validates_length_of :fax, :in => 7..32, :allow_nil => true
0
       #     validates_length_of :phone, :in => 7..32, :allow_blank => true
0
       #     validates_length_of :user_name, :within => 6..20, :too_long => "pick a shorter name", :too_short => "pick a longer name"
0
-      #     validates_length_of :fav_bra_size, :minimum=>1, :too_short=>"please enter at least %d character"
0
-      #     validates_length_of :smurf_leader, :is=>4, :message=>"papa is spelled with %d characters... don't play me."
0
+      #     validates_length_of :fav_bra_size, :minimum => 1, :too_short => "please enter at least %d character"
0
+      #     validates_length_of :smurf_leader, :is => 4, :message => "papa is spelled with %d characters... don't play me."
0
       #   end
0
       #
0
       # Configuration options:
0
-      # * <tt>minimum</tt> - The minimum size of the attribute
0
-      # * <tt>maximum</tt> - The maximum size of the attribute
0
-      # * <tt>is</tt> - The exact size of the attribute
0
-      # * <tt>within</tt> - A range specifying the minimum and maximum size of the attribute
0
-      # * <tt>in</tt> - A synonym(or alias) for :within
0
-      # * <tt>allow_nil</tt> - Attribute may be nil; skip validation.
0
-      # * <tt>allow_blank</tt> - Attribute may be blank; skip validation.
0
-      #
0
-      # * <tt>too_long</tt> - The error message if the attribute goes over the maximum (default is: "is too long (maximum is %d characters)")
0
-      # * <tt>too_short</tt> - The error message if the attribute goes under the minimum (default is: "is too short (min is %d characters)")
0
-      # * <tt>wrong_length</tt> - The error message if using the :is method and the attribute is the wrong size (default is: "is the wrong length (should be %d characters)")
0
-      # * <tt>message</tt> - The error message to use for a :minimum, :maximum, or :is violation.  An alias of the appropriate too_long/too_short/wrong_length message
0
-      # * <tt>on</tt> - Specifies when this validation is active (default is :save, other options :create, :update)
0
-      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
0
+      # * <tt>:minimum</tt> - The minimum size of the attribute
0
+      # * <tt>:maximum</tt> - The maximum size of the attribute
0
+      # * <tt>:is</tt> - The exact size of the attribute
0
+      # * <tt>:within</tt> - A range specifying the minimum and maximum size of the attribute
0
+      # * <tt>:in</tt> - A synonym (or alias) for <tt>:within</tt>
0
+      # * <tt>:allow_nil</tt> - Attribute may be +nil+; skip validation.
0
+      # * <tt>:allow_blank</tt> - Attribute may be blank; skip validation.
0
+      # * <tt>:too_long</tt> - The error message if the attribute goes over the maximum (default is: "is too long (maximum is %d characters)")
0
+      # * <tt>:too_short</tt> - The error message if the attribute goes under the minimum (default is: "is too short (min is %d characters)")
0
+      # * <tt>:wrong_length</tt> - The error message if using the <tt>:is</tt> method and the attribute is the wrong size (default is: "is the wrong length (should be %d characters)")
0
+      # * <tt>:message</tt> - The error message to use for a <tt>:minimum</tt>, <tt>:maximum</tt>, or <tt>:is</tt> violation.  An alias of the appropriate <tt>:too_long</tt>/<tt>too_short</tt>/<tt>wrong_length</tt> message
0
+      # * <tt>:on</tt> - Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>)
0
+      # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).  The
0
+      #   method, proc or string should return or evaluate to a true or false value.
0
+      # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+      #   not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).  The
0
       #   method, proc or string should return or evaluate to a true or false value.
0
-      # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
-      #   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
0
-      #   method, proc or string should return or evaluate to a true or false value.      
0