Skip to content

Commit 61ae9c7

Browse files
committed
version 1.1.0
1 parent ae00083 commit 61ae9c7

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
## [Unreleased]
44

5+
## 1.1.0
6+
57
### Added
68

79
* Add only_columns [#7][]
810

911
### Fixed
1012

11-
* Fix typo in README.md cpunion [#11][] by [@cpunion][]
13+
* Fix typo in README.md [#11][] by [@cpunion][]
1214

1315
### Changed
1416

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ All resource index views will now include a link for download directly
1717
to xls.
1818

1919
```ruby
20-
gem 'activeadmin-xls', '~>1.0.0'
20+
gem 'activeadmin-xls', '~>1.1.0'
2121
```
2222

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

72+
### Restrict columns to a list
73+
74+
```ruby
75+
# app/admin/posts.rb
76+
ActiveAdmin.register Post do
77+
config.xls_builder.only_columns :title, :author
78+
end
79+
```
80+
7281
## Using the DSL
7382

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

101+
# restrict columns to a list without customization
102+
# only_columns :title, :author
103+
92104
# deleting columns from the report
93105
delete_columns :id, :created_at, :updated_at
94106

95-
# adding a column to the report
107+
# adding a column to the report with customization
96108
column(:author) { |post| "#{post.author.first_name} #{post.author.last_name}" }
97109

98110
# inserting additional data with after_filter

lib/active_admin/xls/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module ActiveAdmin
22
module Xls
3-
VERSION = '1.0.5'.freeze
3+
VERSION = '1.1.0'.freeze
44
end
55
end

0 commit comments

Comments
 (0)