Sha256: 43f9d3350e398099c1477de0c806bca6f0c51ee127b4e7df545fbd5f4376e5dc

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 Bytes

Contents

class Admin::AdminController < ActionController::Base
  before_filter :authenticate_admin!
  around_filter :set_locale

  append_view_path(File.join(Rails.root, *%w[app slices]))

  protected

  def presenter_class(page_class)
    Object.const_get("#{page_class.name}Presenter")
  end

  private

  def request_locale
    params[:locale]
  end

  def set_locale
    I18n.with_locale(request_locale || I18n.default_locale) do
      yield
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slices-2.0.2 app/controllers/admin/admin_controller.rb
slices-2.0.1 app/controllers/admin/admin_controller.rb
slices-2.0.0 app/controllers/admin/admin_controller.rb