Implements csv export of registrations

close #1021
This commit is contained in:
Christian Bruckmayer 2016-06-02 15:22:21 +02:00
parent 81ddb76c24
commit 0de4813c27
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1,4 @@
- headers = ['Name', 'Email']
= CSV.generate_line headers
- @registrations.each do |registration|
= CSV.generate_line([registration.name, registration.email])

View file

@ -6,6 +6,7 @@
= "(#{@registrations.length})" if @registrations
.btn-group.pull-right
- if can? :read, Registration
= link_to 'Export CSV', admin_conference_registrations_path(@conference.short_title, format: :csv), class: 'btn btn-success'
= link_to 'Export PDF', admin_conference_registrations_path(@conference.short_title, format: :pdf), class: 'btn btn-success'
= link_to 'Export XLS', {format: :xlsx}, class: 'btn btn-success'
%p.text-muted