Sha256: fc41d1823e64feb57d9539251ad05e92d9a3199701519445ed89e255cf96ae0a

Contents?: true

Size: 824 Bytes

Versions: 3

Compression:

Stored size: 824 Bytes

Contents

---
layout: default
parent: Customizing the Index Page
nav_order: 1
title: Index as a Grid
redirect_from: /docs/3-index-pages/index-as-grid.html
---

# Index as a Grid

Sometimes you want to display the index screen for a set of resources as a grid
(possibly a grid of thumbnail images). To do so, use the :grid option for the
index block.

```ruby
index as: :grid do |product|
  link_to image_tag(product.image_path), admin_product_path(product)
end
```

The block is rendered within a cell in the grid once for each resource in the
collection. The resource is passed into the block for you to use in the view.

You can customize the number of columns that are rendered using the columns
option:

```ruby
index as: :grid, columns: 5 do |product|
  link_to image_tag(product.image_path), admin_product_path(product)
end
```

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activeadmin-rails-1.7.2 docs/3-index-pages/index-as-grid.md
activeadmin-rails-1.7.1 docs/3-index-pages/index-as-grid.md
activeadmin-rails-1.7.0 docs/3-index-pages/index-as-grid.md