Sha256: 7edb738edde686bff84304760d2ad4cef473207d4ae4ac1664aab56bea14ed79

Contents?: true

Size: 714 Bytes

Versions: 6

Compression:

Stored size: 714 Bytes

Contents

module ActiveAdmin

  # All Pages controllers inherit from this controller.
  class PageController < BaseController

    # Active admin actions don't require layout.  All custom actions do.
    ACTIVE_ADMIN_ACTIONS = [:index]

    actions :index

    if ActiveAdmin::Dependency.rails >= 4
      before_action :authorize_access!
    else
      before_filter :authorize_access!
    end

    def index(options={}, &block)
      render "active_admin/page/index"
    end

    def clear_page_actions!
      active_admin_config.clear_page_actions!
    end

    private

    def authorize_access!
      permission = action_to_permission(params[:action])
      authorize! permission, active_admin_config
    end

  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
activeadmin-1.0.0.pre5 lib/active_admin/page_controller.rb
activeadmin-orac-1.0.0.pre4 lib/active_admin/page_controller.rb
activeadmin-orac-1.0.0 lib/active_admin/page_controller.rb
activeadmin-orac-1.0.0.pre.orac lib/active_admin/page_controller.rb
activeadmin-1.0.0.pre4 lib/active_admin/page_controller.rb
activeadmin-1.0.0.pre3 lib/active_admin/page_controller.rb