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