localized_url_for 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module LocalizedUrlFor
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -3,7 +3,9 @@ require 'rails'
3
3
  module LocalizedUrlFor
4
4
 
5
5
  def url_for_with_locale(options)
6
- url_for_without_locale(options.merge(:locale => I18n.locale))
6
+ localized_options = options
7
+ localized_options = options.merge(:locale => I18n.locale) if options.respond_to?(:merge)
8
+ url_for_without_locale(localized_options)
7
9
  end
8
10
 
9
11
  end
@@ -11,4 +13,4 @@ end
11
13
  ActionDispatch::Routing::UrlFor.class_eval do
12
14
  include LocalizedUrlFor
13
15
  alias_method_chain :url_for, :locale
14
- end
16
+ end