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-2.1.5 app/controllers/marty/job_controller.rb
marty-2.1.4 app/controllers/marty/job_controller.rb
marty-2.1.3 app/controllers/marty/job_controller.rb
marty-2.1.2 app/controllers/marty/job_controller.rb
marty-2.1.1 app/controllers/marty/job_controller.rb
marty-2.1.0 app/controllers/marty/job_controller.rb
marty-2.0.9 app/controllers/marty/job_controller.rb
marty-2.0.8 app/controllers/marty/job_controller.rb
marty-2.0.7 app/controllers/marty/job_controller.rb
marty-2.0.6 app/controllers/marty/job_controller.rb
marty-2.0.5 app/controllers/marty/job_controller.rb
marty-2.0.4 app/controllers/marty/job_controller.rb
marty-2.0.3 app/controllers/marty/job_controller.rb
marty-2.0.2 app/controllers/marty/job_controller.rb
marty-2.0.1 app/controllers/marty/job_controller.rb
marty-2.0.0 app/controllers/marty/job_controller.rb
marty-1.2.9 app/controllers/marty/job_controller.rb
marty-1.2.8 app/controllers/marty/job_controller.rb
marty-1.2.7 app/controllers/marty/job_controller.rb
marty-1.2.6 app/controllers/marty/job_controller.rb