aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/url_for.rb
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2010-11-23 00:31:03 +0100
committerJosé Valim <jose.valim@gmail.com>2010-11-23 09:54:42 +0100
commit2fe43b694f36ddb2062a91eebe61a035147265b1 (patch)
treeea99e4fc380ce7b836a3a332337fbdaad4e4f84f /actionpack/lib/action_dispatch/routing/url_for.rb
parent9938a3fc78bf8e066d2cdfe17f3710e0e6b85a36 (diff)
downloadrails-2fe43b694f36ddb2062a91eebe61a035147265b1.tar.gz
rails-2fe43b694f36ddb2062a91eebe61a035147265b1.tar.bz2
rails-2fe43b694f36ddb2062a91eebe61a035147265b1.zip
:subdomain, :domain and :tld_length options can now be used in url_for, allowing for easy manipulation of the host during link generation.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/url_for.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/url_for.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb
index bfdea41f60..6c3fc5126a 100644
--- a/actionpack/lib/action_dispatch/routing/url_for.rb
+++ b/actionpack/lib/action_dispatch/routing/url_for.rb
@@ -115,6 +115,12 @@ module ActionDispatch
# * <tt>:host</tt> - Specifies the host the link should be targeted at.
# If <tt>:only_path</tt> is false, this option must be
# provided either explicitly, or via +default_url_options+.
+ # * <tt>:subdomain</tt> - Specifies the subdomain of the link, using the +tld_length+
+ # to split the domain from the host.
+ # * <tt>:domain</tt> - Specifies the domain of the link, using the +tld_length+
+ # to split the subdomain from the host.
+ # * <tt>:tld_length</tt> - Optionally specify the tld length (only used if :subdomain
+ # or :domain are supplied).
# * <tt>:port</tt> - Optionally specify the port to connect to.
# * <tt>:anchor</tt> - An anchor name to be appended to the path.
# * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in "/archive/2009/"