Class: ThinkFeelDoEngine::Coach::PhqAssessmentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ThinkFeelDoEngine::Coach::PhqAssessmentsController
- Defined in:
- app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb
Overview
Allows a Coach to manage Participants’ phq assessments.
Constant Summary
Constants inherited from ApplicationController
ApplicationController::CSRF_COOKIE_NAME, ApplicationController::CSRF_HEADER_NAME, ApplicationController::INACTIVE_MESSAGE, ApplicationController::ROOT_URI
Instance Method Summary collapse
-
#create ⇒ Object
POST /coach/phq_assessments.
-
#destroy ⇒ Object
DELETE /coach/phq_assessments/1.
-
#edit ⇒ Object
GET /coach/phq_assessments/1/edit.
-
#index ⇒ Object
GET /coach/phq_assessments.
-
#new ⇒ Object
GET /coach/phq_assessments/new.
-
#update ⇒ Object
PATCH/PUT /coach/phq_assessments/1.
Methods inherited from ApplicationController
#access_denied_resource_path, #after_sign_in_path_for, #after_sign_out_path_for, #raise_not_found!, #render_not_found
Instance Method Details
#create ⇒ Object
POST /coach/phq_assessments
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb', line 30 def create @phq_assessment = @participant .phq_assessments .build(coach_phq_assessment_params) :create, @phq_assessment if @phq_assessment.save redirect_to( coach_phq_assessments_url(participant_id: @participant.id), notice: "Phq assessment was successfully created." ) else render :new end end |
#destroy ⇒ Object
DELETE /coach/phq_assessments/1
60 61 62 63 64 65 66 67 |
# File 'app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb', line 60 def destroy :destroy, @phq_assessment @phq_assessment.destroy redirect_to( coach_phq_assessments_url(participant_id: @participant.id), notice: "Phq assessment was successfully destroyed." ) end |
#edit ⇒ Object
GET /coach/phq_assessments/1/edit
25 26 27 |
# File 'app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb', line 25 def edit :edit, @phq_assessment end |
#index ⇒ Object
GET /coach/phq_assessments
13 14 15 16 |
# File 'app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb', line 13 def index @phq_assessments = @participant.phq_assessments :index, PhqAssessment end |
#new ⇒ Object
GET /coach/phq_assessments/new
19 20 21 22 |
# File 'app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb', line 19 def new @phq_assessment = @participant.phq_assessments.build :new, @phq_assessment end |
#update ⇒ Object
PATCH/PUT /coach/phq_assessments/1
47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb', line 47 def update :update, @phq_assessment if @phq_assessment.update(coach_phq_assessment_params) redirect_to( coach_phq_assessments_url(participant_id: @participant.id), notice: "Phq assessment was successfully updated." ) else render :edit end end |