Class: Tasks::Contents::FilterController

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

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#downloadObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/tasks/contents/filter_controller.rb', line 4

def download
  @contents = ::Queries::Content::Filter.new(params).all
    .order('contents.otu_id, contents.topic_id')

  send_data(
    Export::CSV.generate_csv(
      @contents,
      exclude_columns: %w{updated_by_id created_by_id project_id}
    ),
    type: 'text',
    filename: "contents_#{DateTime.now}.tsv"
  )
end