This commit is contained in:
2016-04-21 16:53:30 +02:00
parent fd3111eedf
commit 4a46b14c29
5 changed files with 19 additions and 13 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :set_locale
INPUT_TIMEOUT = 2.seconds # We estimate that a user needs more then x seconds to enter some informations
@@ -18,11 +18,11 @@ class ApplicationController < ActionController::Base
def set_form_timestamp
session[:form_timestamp] = Time.now
end
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
end
# I18n set default language in url
def default_url_options(options = {})
options.merge locale: I18n.locale