Class: ThinkFeelDoEngine::Participants::TaskStatusController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/think_feel_do_engine/participants/task_status_controller.rb

Overview

Updates the completion of assigned tasks for a participant

Constant Summary

Constants inherited from ApplicationController

ApplicationController::CSRF_COOKIE_NAME, ApplicationController::CSRF_HEADER_NAME, ApplicationController::INACTIVE_MESSAGE, ApplicationController::ROOT_URI

Instance Method Summary collapse

Methods inherited from ApplicationController

#access_denied_resource_path, #after_sign_in_path_for, #after_sign_out_path_for

Instance Method Details

#updateObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/think_feel_do_engine/participants/task_status_controller.rb', line 11

def update
  @task_status = current_participant
                 .active_membership
                 .task_statuses
                 .find(params[:id])

  if @task_status.engagements.build && @task_status.mark_complete
    render nothing: true, status: 200
  else
    render nothing: true, status: 400
  end
end