Skip to content

Commit

Permalink
version 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thambley committed Feb 27, 2018
1 parent ae00083 commit 61ae9c7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,13 +2,15 @@

## [Unreleased]

## 1.1.0

### Added

* Add only_columns [#7][]

### Fixed

* Fix typo in README.md cpunion [#11][] by [@cpunion][]
* Fix typo in README.md [#11][] by [@cpunion][]

### Changed

Expand Down
16 changes: 14 additions & 2 deletions README.md
Expand Up @@ -17,7 +17,7 @@ All resource index views will now include a link for download directly
to xls.

```ruby
gem 'activeadmin-xls', '~>1.0.0'
gem 'activeadmin-xls', '~>1.1.0'
```

For Active Admin 1.0, you will also have to update config/initializers/active_admin.rb. Update the download\_links setting to include xls:
Expand Down Expand Up @@ -69,6 +69,15 @@ ActiveAdmin.register Post do
end
```

### Restrict columns to a list

```ruby
# app/admin/posts.rb
ActiveAdmin.register Post do
config.xls_builder.only_columns :title, :author
end
```

## Using the DSL

Everything that you do with the config's default builder can be done via
Expand All @@ -89,10 +98,13 @@ ActiveAdmin.register Post do
# Do not serialize the header, only output data.
# skip_header

# restrict columns to a list without customization
# only_columns :title, :author

# deleting columns from the report
delete_columns :id, :created_at, :updated_at

# adding a column to the report
# adding a column to the report with customization
column(:author) { |post| "#{post.author.first_name} #{post.author.last_name}" }

# inserting additional data with after_filter
Expand Down
2 changes: 1 addition & 1 deletion lib/active_admin/xls/version.rb
@@ -1,5 +1,5 @@
module ActiveAdmin
module Xls
VERSION = '1.0.5'.freeze
VERSION = '1.1.0'.freeze
end
end

0 comments on commit 61ae9c7

Please sign in to comment.