- 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
Customizing the CSV format
Active Admin provides CSV file downloads on the index screen for each Resource. By default it will render a CSV file with all the content columns of your registered model.
Customizing the CSV format is as simple as customizing the index page.
ActiveAdmin.register Post do
csv do
column :title
column("Author") { |post| post.author.full_name }
end
end
You can set custom csv options:
ActiveAdmin.register Post do
csv :options => { :force_quotes => true } do
column :title
column("Author") { |post| post.author.full_name }
end
end
You can set options for the CSV format system-wide:
# config/initializers/active_admin.rb
# Set the CSV builder separator (default is ",")
config.csv_column_separator = ';'
# Set the CSV builder options (default is {})
config.csv_options = { :force_quotes => true }