From 345f030c5b6c0a28ddde56c80a1112b00d345c79 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Tue, 13 May 2008 22:04:20 +0200 Subject: Ensure routing generator works with non-string keys. [#172 state:resolved] Make sure that (with recent correction to globbed parameter escaping) non-string values can still be passed route generation helpers for globbed route segments. For example, foo_path([1, 2, 3]) should still work for a route like map.foo "*globbed" by implicitely calling to_s on the Fixnums. Signed-off-by: Pratik Naik --- actionpack/lib/action_controller/routing/segments.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/routing/segments.rb') diff --git a/actionpack/lib/action_controller/routing/segments.rb b/actionpack/lib/action_controller/routing/segments.rb index b142d18b47..864e068004 100644 --- a/actionpack/lib/action_controller/routing/segments.rb +++ b/actionpack/lib/action_controller/routing/segments.rb @@ -249,7 +249,7 @@ module ActionController end def extract_value - "#{local_name} = hash[:#{key}] && hash[:#{key}].collect { |path_component| URI.escape(path_component, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}" + "#{local_name} = hash[:#{key}] && hash[:#{key}].collect { |path_component| URI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}" end def default -- cgit v1.2.3