From 657925e0e26e07c380ef597e6c1663371171be28 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 1 Mar 2015 13:13:52 -0500 Subject: [PATCH] added metacode to the xls and csv views --- app/models/map.rb | 7 ++++--- app/views/maps/show.xls.erb | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/models/map.rb b/app/models/map.rb index 6bc5704e..ddcefb86 100644 --- a/app/models/map.rb +++ b/app/models/map.rb @@ -84,13 +84,14 @@ class Map < ActiveRecord::Base def to_csv(options = {}) CSV.generate(options) do |csv| - csv << ["id", "name", "permission", "user.name"] + csv << ["id", "name", "metacode", "user.name", "permission"] self.topics.each do |topic| csv << [ topic.id, topic.name, - topic.permission, - topic.user.name + topic.metacode.name, + topic.user.name, + topic.permission ] end end diff --git a/app/views/maps/show.xls.erb b/app/views/maps/show.xls.erb index 7c4f8078..f455ff1d 100644 --- a/app/views/maps/show.xls.erb +++ b/app/views/maps/show.xls.erb @@ -2,15 +2,17 @@ ID Name - Permission + Metacode Username + Permission <% @map.topics.each do |topic| %> <%= topic.id %> <%= topic.name %> - <%= topic.permission %> + <%= topic.metacode.name %> <%= topic.user.name %> + <%= topic.permission %> <% end %>