Enable exporting of events to CSV
This commit is contained in:
parent
921bde2d4e
commit
cb63c66652
|
@ -1,3 +1,4 @@
|
||||||
|
require 'csv'
|
||||||
module Management
|
module Management
|
||||||
class ManagementController < ::ApplicationController
|
class ManagementController < ::ApplicationController
|
||||||
before_action :authenticate_user!, :authorize_user!
|
before_action :authenticate_user!, :authorize_user!
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<%- csv_headers = %w{id title subtitle type track language paticipants status} -%>
|
||||||
|
<%= CSV.generate_line(csv_headers).html_safe -%>
|
||||||
|
<%- @events.each do |event| -%>
|
||||||
|
<%= CSV.generate_line([event.id, event.title, event.subtitle, event.event_type.name, event.track.name, event.language, participant_names_or_emails(event).join(', '), event.status]).html_safe -%>
|
||||||
|
<%- end -%>
|
Loading…
Reference in New Issue