Sha256: 64824d2c29b03fafbb0115989c1736edf84f183e3d3171df9fb4b9671341e49b

Contents?: true

Size: 409 Bytes

Versions: 1

Compression:

Stored size: 409 Bytes

Contents

class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  
  before_filter :set_locale

  def set_locale
    I18n.locale = params[:locale] || session[:locale] || I18n.default_locale
  end

  def default_url_options(options={})
    { locale: I18n.locale }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
woodlock-0.0.1 test/dummy/app/controllers/application_controller.rb