Sha256: 37f6ef8e5310670330fa3e95be7da412e8af58c0c198022cad7e7127f0ca9a14

Contents?: true

Size: 824 Bytes

Versions: 25

Compression:

Stored size: 824 Bytes

Contents

# 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 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

25 entries across 25 versions & 4 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/docs/3-index-pages/custom-index.md
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.17.pre docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.16.pre docs/3-index-pages/custom-index.md
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/docs/3-index-pages/custom-index.md
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/docs/3-index-pages/custom-index.md
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.15.pre docs/3-index-pages/custom-index.md
activeadmin-orac-1.0.0.pre4 docs/3-index-pages/custom-index.md
activeadmin-orac-1.0.0 docs/3-index-pages/custom-index.md
activeadmin-orac-1.0.0.pre.orac docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.14.pre docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.13.pre docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.12.pre docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.11.pre docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.10.pre docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.9.pre docs/3-index-pages/custom-index.md
yousty-activeadmin-1.0.8.pre docs/3-index-pages/custom-index.md
activeadmin-1.0.0.pre4 docs/3-index-pages/custom-index.md
activeadmin-1.0.0.pre3 docs/3-index-pages/custom-index.md