Sha256: 89e4958ffd7e37b191895ed93d30a817d62f66f8e142c1b2b6e016010f396445

Contents?: true

Size: 462 Bytes

Versions: 12

Compression:

Stored size: 462 Bytes

Contents

module StaticBlocks
  class ApplicationController < ActionController::Base

    if StaticBlocks.config.http_auth
      http_basic_authenticate_with :name => StaticBlocks.config.username, :password => StaticBlocks.config.password
    end

    before_filter :set_locale

    private

    def set_locale
      I18n.locale = params[:locale] if params[:locale].present?
    end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
static_blocks-1.2.1 app/controllers/static_blocks/application_controller.rb
static_blocks-1.2.0 app/controllers/static_blocks/application_controller.rb
static_blocks-1.1.5 app/controllers/static_blocks/application_controller.rb
static_blocks-1.1.4 app/controllers/static_blocks/application_controller.rb
static_blocks-1.1.3 app/controllers/static_blocks/application_controller.rb
static_blocks-1.1.2 app/controllers/static_blocks/application_controller.rb
static_blocks-1.1.1 app/controllers/static_blocks/application_controller.rb
static_blocks-1.1.0 app/controllers/static_blocks/application_controller.rb
static_blocks-1.0.3 app/controllers/static_blocks/application_controller.rb
static_blocks-1.0.2 app/controllers/static_blocks/application_controller.rb
static_blocks-1.0.1 app/controllers/static_blocks/application_controller.rb
static_blocks-1.0.0 app/controllers/static_blocks/application_controller.rb