Sha256: 68cff6433d8ce7ee6660d8c356b8687316c641c2608930d36a55b23ab25e67d3

Contents?: true

Size: 846 Bytes

Versions: 12

Compression:

Stored size: 846 Bytes

Contents

# Create an Index

If the supplied Active Admin index components are insufficient for your project
feel free to define your own. Index classes extend ActiveAdmin::Component and
require a build method and an index_name class method.

    module ActiveAdmin
      module Views
      	class IndexAsMyIdea < ActiveAdmin::Component

          def build(page_presenter, collection)
            ...
          end

          def self.index_name
            "my_idea"
          end

        end
      end
    end

The build method takes a PagePresenter object and collection of whatever you
choose.

The index_name class method takes no arguments and returns a string that should
be representative of the the class name. If this method is not defined, your
index component will not be able take advantage of Active Admin's
*multiple index pages* feature.

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
activeadmin-0.6.6 docs/3-index-pages/create-an-index.md
activeadmin-0.6.5 docs/3-index-pages/create-an-index.md
activeadmin-0.6.4 docs/3-index-pages/create-an-index.md
yousty-activeadmin-1.0.4.pre docs/3-index-pages/create-an-index.md
yousty-activeadmin-1.0.3.pre docs/3-index-pages/create-an-index.md
yousty-activeadmin-1.0.2.pre docs/3-index-pages/create-an-index.md
activeadmin-0.6.3 docs/3-index-pages/create-an-index.md
yousty-activeadmin-1.0.1.pre docs/3-index-pages/create-an-index.md
yousty-activeadmin-1.0.0.pre docs/3-index-pages/create-an-index.md
activeadmin-0.6.2 docs/3-index-pages/create-an-index.md
activeadmin-0.6.1 docs/3-index-pages/create-an-index.md
aa-rails4-0.6.0 docs/3-index-pages/create-an-index.md