Sha256: f85653b71cc0dcf787b97b1acf6354905b1916157e0e2c96a5f19dbf436ab549

Contents?: true

Size: 391 Bytes

Versions: 2

Compression:

Stored size: 391 Bytes

Contents

class ApplicationController < ActionController::Base
  include AwesomeTranslations::ControllerTranslateFunctionality

  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  around_action :with_locale

private

  def with_locale(&blk)
    I18n.with_locale(session[:locale] || :en, &blk)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
awesome_translations-0.0.62 spec/dummy/app/controllers/application_controller.rb
awesome_translations-0.0.61 spec/dummy/app/controllers/application_controller.rb