Parent

Class/Module Index [+]

Quicksearch

ApplicationController

Protected Instance Methods

after_sign_in_path_for(resource) click to toggle source
# File app/controllers/application_controller.rb, line 29
def after_sign_in_path_for(resource)
  sign_in_url = new_user_session_path(:only_path => false, :protocol => 'http')
  if request.referer == sign_in_url
    super
  else
    stored_location_for(resource) || root_path
  end
end
current_ability() click to toggle source
# File app/controllers/application_controller.rb, line 68
def current_ability
 @current_ability ||= Ability.new(current_user, request, params[:key])
end
default_url_options() click to toggle source
# File app/controllers/application_controller.rb, line 71
def default_url_options
  {locale: nil, theme: nil , ansicht: nil} # I18n.locale
end
get_theme() click to toggle source
# File app/controllers/application_controller.rb, line 58
  def get_theme
u=current_user
 if ! u.try(:preferredtheme).nil? and ThemesForRails.available_theme_names.include?(u.preferredtheme) 
      u.preferredtheme
  else
    "blue2"
  end

  end
set_i18n_locale_from_params() click to toggle source
# File app/controllers/application_controller.rb, line 8
def set_i18n_locale_from_params
  if params[:locale]
    if I18n.available_locales.include?(params[:locale].to_sym)
      session[:locale] = params[:locale]
    else
      flash.now[:notice]= "#{params[:locale]} translation not available"
      logger.error flash.now[:notice]
    end
  end
  http_header=request.env['HTTP_ACCEPT_LANGUAGE']
  unless http_header.nil?
   ht= http_header.scan(/^de|en/).first
  else
    ht=nil
  end
  I18n.locale = session[:locale]  || I18n.default_locale
  # removed ht from selection add || ht to check http header

  session[:locale] = I18n.locale
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.