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.2.5 app/controllers/marty/job_controller.rb
marty-1.2.4 app/controllers/marty/job_controller.rb
marty-1.2.3 app/controllers/marty/job_controller.rb
marty-1.2.2 app/controllers/marty/job_controller.rb
marty-1.2.1 app/controllers/marty/job_controller.rb
marty-1.2.0 app/controllers/marty/job_controller.rb
marty-1.1.9 app/controllers/marty/job_controller.rb
marty-1.1.8 app/controllers/marty/job_controller.rb
marty-1.1.7 app/controllers/marty/job_controller.rb
marty-1.1.6 app/controllers/marty/job_controller.rb
marty-1.1.5 app/controllers/marty/job_controller.rb
marty-1.1.4 app/controllers/marty/job_controller.rb
marty-1.1.3 app/controllers/marty/job_controller.rb
marty-1.1.2 app/controllers/marty/job_controller.rb
marty-1.1.1 app/controllers/marty/job_controller.rb
marty-1.0.54 app/controllers/marty/job_controller.rb
marty-1.0.53 app/controllers/marty/job_controller.rb
marty-1.0.52 app/controllers/marty/job_controller.rb
marty-1.0.51 app/controllers/marty/job_controller.rb
marty-1.0.50 app/controllers/marty/job_controller.rb