forked from bofh/fetsite
Themen und themes_for_rails neues design
Neues design mit theme=2003 ansehen
This commit is contained in:
@@ -2,6 +2,7 @@ class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
before_filter :set_i18n_locale_from_params
|
||||
protected
|
||||
theme :get_theme
|
||||
def set_i18n_locale_from_params
|
||||
if params[:locale]
|
||||
if I18n.available_locales.include?(params[:locale].to_sym)
|
||||
@@ -12,7 +13,15 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
end
|
||||
def get_theme
|
||||
set_theme(params[:theme])
|
||||
if valid_theme?
|
||||
theme_name
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
def default_url_options
|
||||
{locale: I18n.locale}
|
||||
{locale: I18n.locale, theme:theme_name}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user