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.
- data/lib/localized_url_for/version.rb +1 -1
- data/lib/localized_url_for.rb +4 -2
- data/spec/dummy_app/log/test.log +3547 -0
- metadata +23 -28
data/lib/localized_url_for.rb
CHANGED
@@ -3,7 +3,9 @@ require 'rails'
|
|
3
3
|
module LocalizedUrlFor
|
4
4
|
|
5
5
|
def url_for_with_locale(options)
|
6
|
-
|
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
|