Sha256: e060425473b09d8a7c7c8b7f2d539dbdd64366dc0b27c0a14f660ddb5dcefc95

Contents?: true

Size: 847 Bytes

Versions: 10

Compression:

Stored size: 847 Bytes

Contents

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

```ruby
ActiveAdmin.register Post do
  csv do
    column :title
    column(:author) { |post| post.author.full_name }
  end
end
```

You can also set custom CSV settings for an individual resource:

```ruby
ActiveAdmin.register Post do
  csv force_quotes: true, col_sep: ';' do
    column :title
    column(:author) { |post| post.author.full_name }
  end
end
```

Or system-wide:

```ruby
# config/initializers/active_admin.rb

# Set the CSV builder separator
config.csv_options = { col_sep: ';' }

# Force the use of quotes
config.csv_options = { force_quotes: true }
```

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
yousty-activeadmin-1.0.4.pre docs/4-csv-format.md
yousty-activeadmin-1.0.3.pre docs/4-csv-format.md
active_administration-0.0.3 docs/4-csv-format.md
activeadministration-0.0.2 docs/4-csv-format.md
active_administration-0.0.2 docs/4-csv-format.md
activeadministration-0.0.1 docs/4-csv-format.md
active_administration-0.0.1 docs/4-csv-format.md
yousty-activeadmin-1.0.2.pre docs/4-csv-format.md
yousty-activeadmin-1.0.1.pre docs/4-csv-format.md
yousty-activeadmin-1.0.0.pre docs/4-csv-format.md