Merge pull request #675 from metamaps/feature/no-xls-export

remove excel export
This commit is contained in:
Devin Howard 2016-09-28 22:25:04 +08:00 committed by GitHub
commit cc412ac491
4 changed files with 0 additions and 19 deletions

View file

@ -4,8 +4,6 @@ class MapsController < ApplicationController
before_action :set_map, only: [:show, :update, :destroy, :access, :contains, :events, :export, :screenshot, :star, :unstar] before_action :set_map, only: [:show, :update, :destroy, :access, :contains, :events, :export, :screenshot, :star, :unstar]
after_action :verify_authorized after_action :verify_authorized
respond_to :html, :json, :csv
autocomplete :map, :name, full: true, extra_data: [:user_id] autocomplete :map, :name, full: true, extra_data: [:user_id]
# GET maps/:id # GET maps/:id
@ -24,7 +22,6 @@ class MapsController < ApplicationController
end end
format.json { render json: @map } format.json { render json: @map }
format.csv { redirect_to action: :export, format: :csv } format.csv { redirect_to action: :export, format: :csv }
format.xls { redirect_to action: :export, format: :xls }
end end
end end
@ -118,7 +115,6 @@ class MapsController < ApplicationController
respond_to do |format| respond_to do |format|
format.json { render json: exporter.json } format.json { render json: exporter.json }
format.csv { send_data exporter.csv } format.csv { send_data exporter.csv }
format.xls { @spreadsheet = exporter.xls }
end end
end end

View file

@ -22,10 +22,6 @@ class MapExportService
end end
end end
def xls
to_spreadsheet
end
private private
def topic_headings def topic_headings

View file

@ -1,9 +0,0 @@
<table>
<% @spreadsheet.each do |line| %>
<tr>
<% line.each do |field| %>
<td><%= field %></td>
<% end %>
</tr>
<% end %>
</table>

View file

@ -3,5 +3,3 @@
# Add new mime types for use in respond_to blocks: # Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf # Mime::Type.register "text/richtext", :rtf
Mime::Type.register 'application/xls', :xls