From 0809c675ef5831852b7c1aa8497402b2beff5185 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 31 Oct 2011 17:49:20 -0400 Subject: remove the :path feature to redirects, since it cannot work --- .../lib/action_dispatch/routing/redirection.rb | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb index a234e26151..cd9ba5a4db 100644 --- a/actionpack/lib/action_dispatch/routing/redirection.rb +++ b/actionpack/lib/action_dispatch/routing/redirection.rb @@ -68,23 +68,15 @@ module ActionDispatch def options_proc(options) proc do |params, request| - path = if options[:path].nil? - request.path - elsif params.empty? || !options[:path].match(/%\{\w*\}/) - options.delete(:path) - else - (options.delete(:path) % params) - end - - default_options = { + url_options = { :protocol => request.protocol, - :host => request.host, - :port => request.optional_port, - :path => path, - :params => request.query_parameters - } + :host => request.host, + :port => request.optional_port, + :path => request.path, + :params => request.query_parameters + }.merge options - ActionDispatch::Http::URL.url_for(options.reverse_merge(default_options)) + ActionDispatch::Http::URL.url_for url_options end end -- cgit v1.2.3