From 1c29dd5dc3958d3c8013a822830b511b76d9563c Mon Sep 17 00:00:00 2001 From: Andrew Kofink Date: Mon, 31 Mar 2014 09:50:49 -0400 Subject: [PATCH] A team name may be updated by member students --- app/controllers/student_team_controller.rb | 2 +- app/controllers/versions_controller.rb | 5 +++++ app/views/student_team/edit.html.erb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_team_controller.rb b/app/controllers/student_team_controller.rb index a13541d9d3e..ed2c78736e5 100644 --- a/app/controllers/student_team_controller.rb +++ b/app/controllers/student_team_controller.rb @@ -97,7 +97,7 @@ def leave if other_members.count == 0 old_team = AssignmentTeam.where( ['id = ?', params[:team_id]]) if old_team - old_team.delete + old_team.destroy_all #if assignment has signup sheet then the topic selected by the team has to go back to the pool #or to the first team in the waitlist signups = SignedUpUser.where( {:creator_id => params[:team_id]}) diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 319c795ecbf..e50cb911a57 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -64,4 +64,9 @@ def revert redirect_to :back end + private + + def action_allowed? + true end +end diff --git a/app/views/student_team/edit.html.erb b/app/views/student_team/edit.html.erb index 410a32b9957..71e97addaf1 100644 --- a/app/views/student_team/edit.html.erb +++ b/app/views/student_team/edit.html.erb @@ -1,5 +1,5 @@

Edit Team

-<%= form_tag :action => 'update' do %> +<%= form_tag '/student_team/update', method: :put do %> <%= hidden_field_tag 'team_id', @team.id %> <%= hidden_field_tag 'student_id', @student.id %>