Re: default_url_options documentation

Xavier Noria
Mon, 14 Dec 2009 20:24:33 -0000

Please do not hesitate to join docrails for doc patches, it is much
more agile and we put one ticket less in LH.

Sent from my iPhone

El 30/11/2009, a las 16:44, Jeffrey <ror@abluz.dyndns.org> escribió:

> 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-
> core@googlegroups.com.
> To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com
> .
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
> .
>
>

--

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-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at