Sha256: bc6d7e70c4cf18f182a487116880de66a8faac227bef19db2857531857c637ed

Contents?: true

Size: 674 Bytes

Versions: 4

Compression:

Stored size: 674 Bytes

Contents

module Pwb
  class Export::WebContentsController < ApplicationApiController
    # http://localhost:3000/export/web_contents/all
    def all
      # TODO: - figure out how to get associated cols like raw_en

      headers['Content-Disposition'] = "attachment; filename=\"pwb-web-contents.csv\""
      headers['Content-Type'] ||= 'text/csv'
      # send_data text: (Content.to_csv ["key", "tag", "status", "sort_order", "raw"])
      # above results in below message in chrome:
      # Resource interpreted as Document but transferred with MIME type application/octet-stream
      render plain: (Content.to_csv ["key", "tag", "status", "sort_order", "raw"])
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pwb-1.4.0 app/controllers/pwb/export/web_contents_controller.rb
pwb-1.3.0 app/controllers/pwb/export/web_contents_controller.rb
pwb-1.2.0 app/controllers/pwb/export/web_contents_controller.rb
pwb-1.1.1 app/controllers/pwb/export/web_contents_controller.rb