aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-10-31 17:49:20 -0400
committerAaron Patterson <aaron.patterson@gmail.com>2011-11-18 10:51:11 -0800
commit0809c675ef5831852b7c1aa8497402b2beff5185 (patch)
treed2688601185712bcf62ca7bd118375f4e9e46e97 /actionpack/lib/action_dispatch
parenta8a4264858d5eac4f11ce6545f63e854bbc35759 (diff)
downloadrails-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/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/redirection.rb22
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