Fix an annoying bug with devise and localization
Preserve locale on redirect to the sign in page
This commit is contained in:
parent
cc6a0066a3
commit
55346ef5b4
|
@ -5,11 +5,11 @@ class ApplicationController < ActionController::Base
|
||||||
before_filter :configure_permitted_parameters, if: :devise_controller?
|
before_filter :configure_permitted_parameters, if: :devise_controller?
|
||||||
before_action :set_locale
|
before_action :set_locale
|
||||||
|
|
||||||
def default_url_options(options={})
|
def self.default_url_options(options={})
|
||||||
if params[:locale]
|
if I18n.locale != I18n.default_locale
|
||||||
{locale: I18n.locale}
|
options.merge({locale: I18n.locale})
|
||||||
else
|
else
|
||||||
{}
|
options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue