aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorchoonkeat <choonkeat@gmail.com>2011-12-14 22:43:42 +0800
committerchoonkeat <choonkeat@gmail.com>2011-12-14 22:43:42 +0800
commit5f67cfeda116f2b932ef72781420aa37e62437ca (patch)
treeba15dc4877e1d9f3b734c1fd2fd5b289593e7293 /actionpack/lib/action_dispatch
parenta5589db063e0f527357f6be338adecf4716e6b47 (diff)
downloadrails-5f67cfeda116f2b932ef72781420aa37e62437ca.tar.gz
rails-5f67cfeda116f2b932ef72781420aa37e62437ca.tar.bz2
rails-5f67cfeda116f2b932ef72781420aa37e62437ca.zip
Fix url_for options[:subdomain] to allow objects as values
* e.g. blog_url(subdomain: current_user) instead of blog_url(subdomain: current_user.to_param)
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/url.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index 129a8b1031..64459836b5 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -70,7 +70,7 @@ module ActionDispatch
host = ""
unless options[:subdomain] == false
- host << (options[:subdomain] || extract_subdomain(options[:host], tld_length))
+ host << (options[:subdomain] || extract_subdomain(options[:host], tld_length)).to_param
host << "."
end
host << (options[:domain] || extract_domain(options[:host], tld_length))