GitHub Account angelegt

This commit is contained in:
Andreas Stephanides
2013-02-12 02:05:12 +01:00
commit 3d11400d5e
216 changed files with 5031 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_i18n_locale_from_params
protected
def set_i18n_locale_from_params
if params[:locale]
if I18n.available_locales.include?(params[:locale].to_sym)
I18n.locale=params[:locale].to_sym
else
flash.now[:notice]= "#{params[:locale]} translation not available"
logger.error flash.now[:notice]
end
end
end
def default_url_options
{locale: I18n.locale}
end
end