Class: ThinkFeelDoDashboard::CoachAssignmentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ThinkFeelDoDashboard::CoachAssignmentsController
- Defined in:
- app/controllers/think_feel_do_dashboard/coach_assignments_controller.rb
Overview
Used to associated coaches with participants
Instance Method Summary collapse
-
#create ⇒ Object
POST /think_feel_do_dashboard/participants/1/coaches.
-
#destroy ⇒ Object
DELETE /think_feel_do_dashboard/participants/1/coaches/1.
-
#edit ⇒ Object
GET /think_feel_do_dashboard/participants/1/coaches/1/edit.
-
#new ⇒ Object
GET /think_feel_do_dashboard/participants/1/coaches/new.
-
#show ⇒ Object
GET /think_feel_do_dashboard/participants/1/coaches/1.
-
#update ⇒ Object
PATCH/PUT /think_feel_do_dashboard/participants/1/coaches/1.
-
#woz ⇒ Object
GET /think_feel_do_dashboard/participants/1/coaches/woz.
Instance Method Details
#create ⇒ Object
POST /think_feel_do_dashboard/participants/1/coaches
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/think_feel_do_dashboard/coach_assignments_controller.rb', line 17 def create :create, CoachAssignment @coach_assignment = @participant.build_coach_assignment( coach_assignment_params ) if @coach_assignment.save redirect_to participant_path(@participant), notice: "Coach/Moderator was successfully assigned." else render :new end end |
#destroy ⇒ Object
DELETE /think_feel_do_dashboard/participants/1/coaches/1
55 56 57 58 59 60 61 62 63 64 |
# File 'app/controllers/think_feel_do_dashboard/coach_assignments_controller.rb', line 55 def destroy :destroy, @coach_assignment if @coach_assignment.destroy redirect_to participant_path(@participant), notice: "Coach/Moderator was successfully removed." else redirect_to participant_path(@participant), alert: "There were errors." end end |
#edit ⇒ Object
GET /think_feel_do_dashboard/participants/1/coaches/1/edit
37 38 39 |
# File 'app/controllers/think_feel_do_dashboard/coach_assignments_controller.rb', line 37 def edit :edit, @coach_assignment end |
#new ⇒ Object
GET /think_feel_do_dashboard/participants/1/coaches/new
12 13 14 |
# File 'app/controllers/think_feel_do_dashboard/coach_assignments_controller.rb', line 12 def new :new, CoachAssignment end |
#show ⇒ Object
GET /think_feel_do_dashboard/participants/1/coaches/1
32 33 34 |
# File 'app/controllers/think_feel_do_dashboard/coach_assignments_controller.rb', line 32 def show :read, @coach_assignment end |
#update ⇒ Object
PATCH/PUT /think_feel_do_dashboard/participants/1/coaches/1
42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/think_feel_do_dashboard/coach_assignments_controller.rb', line 42 def update :update, @coach_assignment if @coach_assignment.update(coach_assignment_params) redirect_to participant_path( @participant ), notice: "Coach/Moderator was successfully assigned." else render :edit end end |
#woz ⇒ Object
GET /think_feel_do_dashboard/participants/1/coaches/woz
67 68 69 70 71 72 73 74 75 76 77 |
# File 'app/controllers/think_feel_do_dashboard/coach_assignments_controller.rb', line 67 def woz if @participant.coach set_coach_assignment :edit, @coach_assignment update_woz_coach else :new, CoachAssignment set_new_woz_coach end end |