The embedded documentation for ActionController#default_url_options()
is incomplete, inaccurate or at least misleading.  Applying it as
shown to an application will cause the automated tests to fail on
argument count mismatches.   And other tests that check host in URLs
may start failing if :host is overwritten.  The patch below corrects
both problems.  It is against Rails 2.3.5.  It probably also applies
to earlier versions.

Jeffrey

--- base.rb~    2009-11-28 17:56:00.000000000 -0600
+++ base.rb     2009-11-30 09:35:43.000000000 -0600
@@ -1062,8 +1062,8 @@
       # Overwrite to implement a number of default options that all
url_for-based methods will use. The default options should come in
       # the form of a hash, just like the one you would use for
url_for directly. Example:
       #
-      #   def default_url_options(options)
-      #     { :project => @project.active? ? @project.url_name :
"unknown" }
+      #   def default_url_options(options = nil)
+      #     super( { :project => @project.active? ?
@project.url_name : "unknown" } )
       #   end
       #
       # As you can infer from the example, this is mostly useful for
situations where you want to centralize dynamic decisions about the

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-c...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.


Reply via email to