Sha256: def41e862b443f074da2aa45686613b932526b498793283000c7b1a2758c0418

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 Bytes

Contents

class LocalesController < ApplicationController

  skip_before_action :verify_authenticity_token

  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

1 entries across 1 versions & 1 rubygems

Version Path
i18n_helper-0.0.3 app/controllers/locales_controller.rb