Class: Tasks::ObservationMatrices::ImageMatrixController

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

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#api_keyObject

GET /api/v1/observation_matrices/123/image_matrix.json



14
15
16
17
# File 'app/controllers/tasks/observation_matrices/image_matrix_controller.rb', line 14

def api_key
  @key = Tools::ImageMatrix.new(**image_key_params)
  render '/observation_matrices/api/v1/image_matrix'
end

#image_key_paramsObject (protected)

params[:observation_matrix_id, :project_id, :observation_matrix, :language_id, :keyword_ids, :row_filter,

:per, :page, :otu_filter, :identified_to_rank]


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/controllers/tasks/observation_matrices/image_matrix_controller.rb', line 23

def image_key_params
  params.permit(
      :observation_matrix_id,
      :language_id,
      :row_filter,
      :otu_filter,
      :sorting,
      :eliminate_unknown,
      :error_tolerance,
      :identified_to_rank,
      :selected_descriptors,
      :per,
      :page,
      keyword_ids: [] # arrays must be at the end
  ).to_h.symbolize_keys.merge(project_id: sessions_current_project_id)
end

#indexObject

GET /tasks/observation_matrices/image_matrix



5
6
# File 'app/controllers/tasks/observation_matrices/image_matrix_controller.rb', line 5

def index
end

#keyObject

GET /tasks/observation_matrices/image_matrix/37/key



9
10
11
# File 'app/controllers/tasks/observation_matrices/image_matrix_controller.rb', line 9

def key
  @key = Tools::ImageMatrix.new(**image_key_params)
end