KyivKrishnaAcademy/ved_akadem_students

View on GitHub
app/controllers/group_participations_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
D
60%
class GroupParticipationsController < ApplicationController
  before_action :set_resource, only: [:destroy]

  after_action :verify_authorized

  def destroy
    params[:leave] ? @group_participation.leave! : @group_participation.destroy

    redirect_to @group_participation.student_profile.person
  end

  private

  def set_resource
    @group_participation = GroupParticipation.find(params[:id])

    authorize @group_participation
  end
end