aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/routing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/routing.rb')
-rw-r--r--actionpack/lib/action_controller/routing.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index a522b34f73..d270defa4d 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -215,8 +215,9 @@ module ActionController
options = options.symbolize_keys
defaults = request.path_parameters.symbolize_keys
- options = defaults if options.empty? # Get back the current url if no options was passed
- expand_controller_path!(options, defaults)
+ if options.empty? then options = defaults.clone # Get back the current url if no options was passed
+ else expand_controller_path!(options, defaults) # Expand the supplied controller path.
+ end
defaults.delete_if {|k, v| options.key?(k) && options[k].nil?} # Remove defaults that have been manually cleared using :name => nil
failures = []