Skip to content

Commit

Permalink
feat: replace fail by flast alert
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-by-ouidou authored and seb-by-ouidou committed Jan 17, 2024
1 parent 2368143 commit 562a52a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/gestionnaires/groupe_gestionnaires_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ def update

def destroy
if !@groupe_gestionnaire.can_be_deleted?(current_gestionnaire)
fail "Impossible de supprimer ce groupe.."
end
@groupe_gestionnaire.destroy

flash[:notice] = "Le groupe #{@groupe_gestionnaire.id} est supprimé"
flash[:alert] = "Impossible de supprimer ce groupe.."
else
@groupe_gestionnaire.destroy

flash[:notice] = "Le groupe #{@groupe_gestionnaire.id} est supprimé"
end
redirect_to gestionnaire_groupe_gestionnaires_path
end

Expand Down

0 comments on commit 562a52a

Please sign in to comment.