Sha256: c7a9266c77a3d5fd5ba7ee15bd96797f75fef08845bb17549f5337a4e11bd3b3

Contents?: true

Size: 882 Bytes

Versions: 36

Compression:

Stored size: 882 Bytes

Contents

---
redirect_from: /docs/3-index-pages/custom-index.html
---

# Custom Index

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

```ruby
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 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

36 entries across 36 versions & 3 rubygems

Version Path
activeadmin-2.13.1 docs/3-index-pages/custom-index.md
activeadmin-2.13.0 docs/3-index-pages/custom-index.md
activeadmin-2.12.0 docs/3-index-pages/custom-index.md
activeadmin-2.11.2 docs/3-index-pages/custom-index.md
activeadmin-2.11.1 docs/3-index-pages/custom-index.md
activeadmin-2.11.0 docs/3-index-pages/custom-index.md
activeadmin-2.10.1 docs/3-index-pages/custom-index.md
activeadmin-2.10.0 docs/3-index-pages/custom-index.md
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/docs/3-index-pages/custom-index.md
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/docs/3-index-pages/custom-index.md
activeadmin-2.9.0 docs/3-index-pages/custom-index.md
activeadmin-2.8.1 docs/3-index-pages/custom-index.md
activeadmin-2.8.0 docs/3-index-pages/custom-index.md
activeadmin-2.7.0 docs/3-index-pages/custom-index.md
activeadmin-2.6.1 docs/3-index-pages/custom-index.md
activeadmin-2.6.0 docs/3-index-pages/custom-index.md
activeadmin-2.5.0 docs/3-index-pages/custom-index.md
activeadmin-2.4.0 docs/3-index-pages/custom-index.md
activeadmin-2.3.1 docs/3-index-pages/custom-index.md
activeadmin-2.3.0 docs/3-index-pages/custom-index.md