semester_process_volunteers_controller.rb 1022 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class SemesterProcessVolunteersController < ApplicationController
  before_action :set_semester_process_volunteer, only: [:show, :edit, :update]

  def index
    authorize SemesterProcessVolunteer
    @semester_process = SemesterProcess.find(params[:semester_process_id])
    @semester_process_volunteers = @semester_process.semester_process_volunteers
  end

  def show; end

  def edit; end

  def update
    if @semester_process_volunteer.update(semester_process_params)
      redirect_to @semester_process_volunteer, notice: 'Semester process was successfully updated.'
    else
      render :edit
    end
  end

  private

  def set_semester_process_volunteer
    @semester_process_volunteer = SemesterProcess.find(params[:id])
    authorize @semester_process_volunteer
    @semester_process = @semester_process_volunteer.semester_process
    @volunteer = @semester_process_volunteer.volunteer
  end

  def semester_process_volunteer_params
    params.require(:semester_process_volunteer).permit(:semester)
  end
end