Sha256: 0b38e25f17386fc644f5940c81370f0af2d3860a664c7bcf456ab3930edbb447

Contents?: true

Size: 770 Bytes

Versions: 1

Compression:

Stored size: 770 Bytes

Contents

module Admin
  # Public: Base admin system controller. Contains authentication, a dashboard, and a
  # style guide. Anything that must affect all admin pages should be added here.
  class AdminController < ::ApplicationController
    # An AdminMiddleware module can be added to change any part of the
    # base AdminController class' functionality.
    try(:include, ::AdminMiddleware)

    before_action :authenticate_admin!

    layout "admin/application"

    def dashboard
      render 'admin/dashboard'
    end

    def styleguide
      render 'admin/styleguide'
    end

    # Defers to #authenticate_admin! in ApplicationController if it is defined
    # If not, returns false/does nothing
    def authenticate_admin!
      super rescue false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ceo-0.2.0 app/controllers/admin/admin_controller.rb