Class: Tasks::Exports::ColdpController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/exports/coldp_controller.rb

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#downloadObject


7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/tasks/exports/coldp_controller.rb', line 7

def download
  redirect_to export_coldp_task_path, notice: 'Nothing selected' and return unless !params[:otu_id].blank?
  @otu = Otu.where(project_id: sessions_current_project_id).find(params.require(:otu_id))
  if @otu.taxon_name
    if Rails.env == 'development'
      download = ::Export::Coldp.download(@otu, request.url)
    else
      download = ::Export::Coldp.download_async(@otu, request.url)
    end
    redirect_to download_file_download_path(download)
  else
    redirect_to export_coldp_task_path, notice: 'Please select an OTU that is linked to the nomenclature (has a taxon name).'
  end
end

#indexObject


4
5
# File 'app/controllers/tasks/exports/coldp_controller.rb', line 4

def index
end