From b546945b51d1e5765b4bf4eba0bd8413ea8e4198 Mon Sep 17 00:00:00 2001 From: wycats Date: Sun, 4 Apr 2010 13:00:22 -0700 Subject: Reapply redirect {|params, request| } with passing tests this time --- actionpack/lib/action_dispatch/routing/mapper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/routing') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index ffa178345b..925e91f081 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -243,7 +243,11 @@ module ActionDispatch lambda do |env| req = Request.new(env) - uri = URI.parse(path_proc.call(req.symbolized_path_parameters)) + + params = [req.symbolized_path_parameters] + params << req if path_proc.arity > 1 + + uri = URI.parse(path_proc.call(*params)) uri.scheme ||= req.scheme uri.host ||= req.host uri.port ||= req.port unless req.port == 80 -- cgit v1.2.3