added metacode to the xls and csv views
This commit is contained in:
parent
b5b13841bc
commit
657925e0e2
2 changed files with 8 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Permission</th>
|
||||
<th>Metacode</th>
|
||||
<th>Username</th>
|
||||
<th>Permission</th>
|
||||
</tr>
|
||||
<% @map.topics.each do |topic| %>
|
||||
<tr>
|
||||
<td><%= topic.id %></td>
|
||||
<td><%= topic.name %></td>
|
||||
<td><%= topic.permission %></td>
|
||||
<td><%= topic.metacode.name %></td>
|
||||
<td><%= topic.user.name %></td>
|
||||
<td><%= topic.permission %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue