Sha256: aa97e4d6a79be57d9126fa08fca57c5dc24448317c0d7f67f7f9c43cc6d9c20b

Contents?: true

Size: 442 Bytes

Versions: 3

Compression:

Stored size: 442 Bytes

Contents

class LocalesController < ApplicationController

  def setting
    if params[:locale] and I18n.available_locales.include?(params[:locale].to_sym)
      session[:locale] = params[:locale]
      I18n.locale = params[:locale]
      if self.respond_to? :current_user
        if current_user and current_user.respond_to?(:locale)
          current_user.update locale: params[:locale]
        end
      end
    end
    redirect_to :back
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
i18n_helper-0.0.4 app/controllers/locales_controller.rb
i18n_helper-0.0.2 app/controllers/locales_controller.rb
i18n_helper-0.0.1 app/controllers/locales_controller.rb