From e46122e2d32cf32ca8cdfeeed0158f92bdb17ded Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 31 Mar 2009 16:33:09 +0800 Subject: [PATCH] now also handling globbed routes as expected Signed-off-by: Sven Fuchs --- lib/routing_filter/locale.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/routing_filter/locale.rb b/lib/routing_filter/locale.rb index be231c0..5e86701 100644 --- a/lib/routing_filter/locale.rb +++ b/lib/routing_filter/locale.rb @@ -26,8 +26,9 @@ def around_generate(*args, &block) locale = args.extract_options!.delete(:locale) || I18n.locale returning yield do |result| if locale.to_sym != @@default_locale - result.sub!(%r(^(http.?://[^/]*)?(.*))){ "#{$1}/#{locale}#{$2}" } - end + target = result.is_a?(Array) ? result.first : result + target.sub!(%r(^(http.?://[^/]*)?(.*))){ "#{$1}/#{locale}#{$2}" } +< end end end end