Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customisation of header names when rendering a collection #1

Open
michiels opened this issue May 12, 2018 · 0 comments
Open

Allow customisation of header names when rendering a collection #1

michiels opened this issue May 12, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@michiels
Copy link
Member

michiels commented May 12, 2018

The CsvExport#render_collection(a_collection) method currently uses the fields passed into CsvExport.new to read column values from the objects in a_collection. This makes it really easy to provide clear-cut CSV exports.

However, sometimes we want to name columns just a little bit different than their underlying field name or virtual attribute.

For example, we could update the #new method to support the following:

export = CsvExport.new(id: :number, name: :full_name)
export.render_collection(@customers)
@michiels michiels added the enhancement New feature or request label May 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant