Permalink
Browse files

push arg checking up

  • Loading branch information...
1 parent 6004c75 commit 960398cb261ba1a1ee331d79976be486f957cd78 @tenderlove tenderlove committed May 20, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 actionpack/lib/action_dispatch/http/url.rb
@@ -30,6 +30,10 @@ def extract_subdomain(host, tld_length = @@tld_length)
end
def url_for(options)
+ unless options[:host] || options[:only_path]
+ raise ArgumentError, 'Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true'
+ end
+
path = options[:script_name].to_s.chomp("/")
path << options[:path].to_s
@@ -61,10 +65,6 @@ def url_for(options)
private
def build_host_url(options)
- unless options[:host] || options[:only_path]
- raise ArgumentError, 'Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true'
- end
-
result = ""
unless options[:only_path]

0 comments on commit 960398c

Please sign in to comment.