Sha256: 54325ebbdd4bcf9d76ec193a93100ab44a58f07e9c94d0e2f591f260805c119e

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

require "godmin/helpers/application"
require "godmin/helpers/forms"
require "godmin/helpers/navigation"
require "godmin/helpers/translations"

module Godmin
  module ApplicationController
    extend ActiveSupport::Concern

    included do
      include Godmin::Helpers::Translations

      helper Godmin::Helpers::Application
      helper Godmin::Helpers::Forms
      helper Godmin::Helpers::Navigation
      helper Godmin::Helpers::Translations

      helper_method :authentication_enabled?
      helper_method :authorization_enabled?

      before_action :prepend_view_paths

      layout "godmin/application"
    end

    def welcome; end

    private

    def prepend_view_paths
      prepend_view_path Godmin::GodminResolver.new(controller_name)
      prepend_view_path Godmin::EngineResolver.new(controller_name)
    end

    def authentication_enabled?
      singleton_class.include?(Godmin::Authentication)
    end

    def authorization_enabled?
      singleton_class.include?(Godmin::Authorization)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
godmin-0.12.0 lib/godmin/application_controller.rb