diff --git a/app/controllers/management/management_controller.rb b/app/controllers/management/management_controller.rb index d50b412..b2818be 100644 --- a/app/controllers/management/management_controller.rb +++ b/app/controllers/management/management_controller.rb @@ -1,3 +1,4 @@ +require 'csv' module Management class ManagementController < ::ApplicationController before_action :authenticate_user!, :authorize_user! diff --git a/app/views/management/events/index.csv.erb b/app/views/management/events/index.csv.erb new file mode 100644 index 0000000..1a04c93 --- /dev/null +++ b/app/views/management/events/index.csv.erb @@ -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 -%>