Sha256: ce055fe4f16df1aee27a3f801018d69eb9ca8263e2d0a887310d0f58fc446e0c

Contents?: true

Size: 725 Bytes

Versions: 112

Compression:

Stored size: 725 Bytes

Contents

class Marty::JobController < ActionController::Base
  def download
    job_id = params["job_id"]

    promise = Marty::Promise.find_by_id(job_id)

    if promise
      format = promise.cformat
      # somewhat hacky: if result has "result" key, it's used as the
      # content.
      data = promise.result["result"] || promise.result
      title = promise.title
    else
      format = "json"
      data = {error: "Job not found: #{job_id}"}
      title = "error"
    end

    res, type, disposition, filename =
      Marty::ContentHandler.export(data, format, title)

    send_data(res,
              type:        type,
              filename:    filename,
              disposition: disposition,
              )
  end
end

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
marty-1.0.26 app/controllers/marty/job_controller.rb
marty-1.0.25 app/controllers/marty/job_controller.rb
marty-1.0.24 app/controllers/marty/job_controller.rb
marty-1.0.23 app/controllers/marty/job_controller.rb
marty-1.0.22 app/controllers/marty/job_controller.rb
marty-1.0.20 app/controllers/marty/job_controller.rb
marty-1.0.19 app/controllers/marty/job_controller.rb
marty-1.0.18 app/controllers/marty/job_controller.rb
marty-1.0.17 app/controllers/marty/job_controller.rb
marty-1.0.15 app/controllers/marty/job_controller.rb
marty-1.0.14 app/controllers/marty/job_controller.rb
marty-1.0.13 app/controllers/marty/job_controller.rb
marty-1.0.12 app/controllers/marty/job_controller.rb
marty-1.0.11 app/controllers/marty/job_controller.rb
marty-1.0.10 app/controllers/marty/job_controller.rb
marty-1.0.9 app/controllers/marty/job_controller.rb
marty-1.0.8 app/controllers/marty/job_controller.rb
marty-1.0.7 app/controllers/marty/job_controller.rb
marty-1.0.6 app/controllers/marty/job_controller.rb
marty-1.0.5 app/controllers/marty/job_controller.rb