diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-20 15:23:38 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-20 15:23:38 -0700 |
commit | 960398cb261ba1a1ee331d79976be486f957cd78 (patch) | |
tree | e2ac415b0a0e581f964463d32a21aa70e737d6cd /actionpack/lib | |
parent | 6004c753fed39402fbb014c33a51694d555123de (diff) | |
download | rails-960398cb261ba1a1ee331d79976be486f957cd78.tar.gz rails-960398cb261ba1a1ee331d79976be486f957cd78.tar.bz2 rails-960398cb261ba1a1ee331d79976be486f957cd78.zip |
push arg checking up
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index ffba0a82d2..dc4434309a 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -30,6 +30,10 @@ module ActionDispatch 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 @@ module ActionDispatch 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] |