- Installation
- General Configuration
- Authentication
- Site Title Options
- Internationalization (I18n)
- Namespaces
- Load paths
- Comments
- Utility Navigation
- Customize The Resource
- Rename the Resource
- Customize the Namespace
- Customize the Menu
- Scoping the queries
- Customizing resource retrieval
- Belongs To
- Customizing the Index Page
- Customizing the CSV format
- Customizing the Form
- Customizing the Show Screen
- Sidebar Sections
- Custom Controller Actions
- Collection Actions
- Member Actions
- Controller Action HTTP Verb
- Rendering in Custom Actions
- Modify the Controller
- Index Batch Actions
- Custom Pages
- Available Features
- Create a new Page
- Page Title & I18n
- Customize the Menu
- Add a Sidebar Section
- Add an Action Item
- Add a Page Action
- Decorators
- Arbre Components
- Authorization Adapter
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.
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 colums that are rendered using the columns option:
index :as => :grid, :columns => 5 do |product|
link_to(image_tag(product.image_path), admin_product_path(product))
end