diff --git a/app/views/home/_talk_preference.csv.erb b/app/views/home/_talk_preference.csv.erb index 961f575..79dff36 100644 --- a/app/views/home/_talk_preference.csv.erb +++ b/app/views/home/_talk_preference.csv.erb @@ -1 +1,3 @@ -<%= CSV.generate_line([talk_preference.hashed_unique_id, talk_preference.created_at] + @talks.map(&:id).map { |talk| talk_preference.include? talk }).html_safe -%> +<% talk_preference.talks.each do |talk| %> + <%= CSV.generate_line([talk_preference.hashed_unique_id, talk_preference.created_at, talk]).html_safe -%> +<% end %> diff --git a/app/views/home/export.csv.erb b/app/views/home/export.csv.erb index ee7483a..56469cb 100644 --- a/app/views/home/export.csv.erb +++ b/app/views/home/export.csv.erb @@ -1,3 +1,3 @@ -<%- headers = ['ID', 'Created at'] + @talks.map(&:id) -%> +<%- headers = ['ID', 'Created at', 'Talk'] -%> <%= CSV.generate_line headers -%> <%= render partial: 'talk_preference', collection: @talk_preferences %>