Last active
June 2, 2016 12:15
-
-
Save Bahanix/13d99048d7a224ecf96e9e0163818cb5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
before_action :set_locale | |
private | |
def set_locale | |
if session[:locale] | |
I18n.locale = session[:locale] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
À vous de créer le formulaire pour mettre à jour la variable de session
session[:locale]
. Je l'ai appelé ainsi, mais cela aurait pu tout à faire êtresession[:ma_langue]
.