diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-12 11:45:10 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-19 14:19:44 -0700 |
commit | ef686a60951342a189cc82bfc4823180a6cf3a32 (patch) | |
tree | e14033fffbe59bde0c634740821611c4bbc90766 /actionpack/lib/action_dispatch/http | |
parent | efb41c6abc39b71183d3f13a267f801576a399cb (diff) | |
download | rails-ef686a60951342a189cc82bfc4823180a6cf3a32.tar.gz rails-ef686a60951342a189cc82bfc4823180a6cf3a32.tar.bz2 rails-ef686a60951342a189cc82bfc4823180a6cf3a32.zip |
add both branches to the only_path conditional
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index a5858758c6..3997c6ee98 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -36,13 +36,13 @@ module ActionDispatch path = options[:script_name].to_s.chomp("/") path << options[:path].to_s - add_trailing_slash(path) if options[:trailing_slash] + path = add_trailing_slash(path) if options[:trailing_slash] - result = path - - unless options[:only_path] - result.prepend build_host_url(options) - end + result = if options[:only_path] + path + else + build_host_url(options).concat path + end if options.key? :params params = options[:params].is_a?(Hash) ? |