Guest User

Untitled

a guest
Apr 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. ActionView::Helpers::UrlHelper.class_eval do
  2. unless method_defined?(:url_for_without_locale)
  3. def url_for_with_locale(options = {})
  4. case options
  5. when Hash
  6. url_for_without_locale(options.merge({:locale => I18n.locale.to_s}))
  7. else
  8. url_for_without_locale(options)
  9. end
  10. end
  11.  
  12. alias_method_chain :url_for, :locale
  13. end
  14. end
Add Comment
Please, Sign In to add comment