Sha256: bf455fb26d7470012a00400c54f6ffdcd46cd14f62d3299f841c0b4b9920b2bc

Contents?: true

Size: 1.28 KB

Versions: 1

Compression:

Stored size: 1.28 KB

Contents

module ActiveAdmin
  # Page is the primary data storage for page configuration in Active Admin
  #
  # When you register a page (ActiveAdmin.page "Status") you are actually creating
  # a new Page instance within the given Namespace.
  #
  # The instance of the current page is available in PageController and views
  # by calling the #active_admin_config method.
  #
  class Page

    # The namespace this config belongs to
    attr_reader :namespace

    # The name of the page
    attr_reader :name

    module Base
      def initialize(namespace, name, options)
        @namespace = namespace
        @name = name
        @options = options
      end
    end

    include Base
    include Resource::Controllers
    include Resource::PagePresenters
    include Resource::Sidebars
    include Resource::ActionItems
    include Resource::Menu
    include Resource::Naming

    # plural_resource_name is singular
    def resource_name
      name
    end

    def safe_resource_name
      name
    end


    # Force plural to be singular
    def plural_resource_name
      name
    end

    # Force plural to be singular
    def plural_safe_resource_name
      name
    end

    def belongs_to?
      false
    end

    def add_default_action_items
    end

    def add_default_sidebar_sections
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-0.4.0 lib/active_admin/page.rb