diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-31 17:49:20 -0400 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-18 10:51:11 -0800 |
commit | 0809c675ef5831852b7c1aa8497402b2beff5185 (patch) | |
tree | d2688601185712bcf62ca7bd118375f4e9e46e97 /actionpack/lib | |
parent | a8a4264858d5eac4f11ce6545f63e854bbc35759 (diff) | |
download | rails-0809c675ef5831852b7c1aa8497402b2beff5185.tar.gz rails-0809c675ef5831852b7c1aa8497402b2beff5185.tar.bz2 rails-0809c675ef5831852b7c1aa8497402b2beff5185.zip |
remove the :path feature to redirects, since it cannot work
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/redirection.rb | 22 |
1 files changed, 7 insertions, 15 deletions
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 |