Files
fetsite/app/controllers/application_controller.rb
Andreas Stephanides cdf7acd426 Wiki Erstentwurf,
gollum installiert und Aktiviert,
noch nicht fertig!

Neuigkeiten / Rubriken Verwaltung verbessert
+ Neue Neuigkeiten einfügen,
+ Liste der Neuigkeiten einer Kategorie
+ html für Neuigkeiten
2013-03-02 14:09:12 +01:00

19 lines
533 B
Ruby

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, host:"128.131.95.212"}
end
end