Class: Tasks::ObservationMatrices::ObservationMatrixHubController

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

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#copy_observationsObject



9
10
11
12
13
14
15
# File 'app/controllers/tasks/observation_matrices/observation_matrix_hub_controller.rb', line 9

def copy_observations
  if Observation.copy(params[:old_global_id], params[:new_global_id])
    render json: {success: true, status: :created}
  else
    render json: {success: false, status: :unprocessable_entity }
  end
end

#indexObject

GET



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

def index
  @observation_matrices = ObservationMatrix.where(project_id: sessions_current_project_id).order(updated_at: :desc)
end