From ce3b464e48648f5f896300cf980dad000fb8094b Mon Sep 17 00:00:00 2001 From: hukl Date: Fri, 20 Feb 2009 11:09:27 +0100 Subject: another modification for the routing filter --- vendor/plugins/routing-filter/lib/routing_filter/locale.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vendor/plugins/routing-filter/lib/routing_filter/locale.rb b/vendor/plugins/routing-filter/lib/routing_filter/locale.rb index 0aa6adc..6fc3e11 100644 --- a/vendor/plugins/routing-filter/lib/routing_filter/locale.rb +++ b/vendor/plugins/routing-filter/lib/routing_filter/locale.rb @@ -26,9 +26,8 @@ module RoutingFilter locale = args.extract_options!.delete(:locale) || I18n.locale returning yield do |result| if locale.to_sym != @@default_locale - if result.respond_to?(:sub) - 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 -- cgit v1.3