Class: LocaleController

Inherits:
Spree::BaseController
  • Object
show all
Defined in:
app/controllers/locale_controller.rb

Instance Method Summary collapse

Instance Method Details

#setObject



2
3
4
5
# File 'app/controllers/locale_controller.rb', line 2

def set
  session[:locale] = I18n.locale = params[:locale].to_sym if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
  redirect_back_or_default(params[:return_path] ? "/#{params[:return_path]}" : root_path)
end