diff --git a/app/controllers/lab_assistants_controller.rb b/app/controllers/lab_assistants_controller.rb index 6a184d9..c61d97f 100644 --- a/app/controllers/lab_assistants_controller.rb +++ b/app/controllers/lab_assistants_controller.rb @@ -1,5 +1,5 @@ class LabAssistantsController < ApplicationController - + def create @la = LabAssistant.new(la_params) @la.password = 'password' @@ -10,6 +10,8 @@ def create @la.course_id = 2 when 'CS61C' @la.course_id = 3 + when 'CS10' + @la.course_id = 4 else # potential other classes end @@ -37,7 +39,7 @@ def la_params def update if params['lt_ids'] current_user.preferred_lab_times = params['lt_ids'].map(&:to_i) - else + else current_user.preferred_lab_times = [] end current_user.save diff --git a/app/controllers/lab_times_controller.rb b/app/controllers/lab_times_controller.rb index 47f2565..c0ac05a 100644 --- a/app/controllers/lab_times_controller.rb +++ b/app/controllers/lab_times_controller.rb @@ -18,6 +18,8 @@ def create @lt.course_id = 2 when 'CS61C' @lt.course_id = 3 + when 'CS10' + @lt.course_id = 4 else # potential other classes end diff --git a/app/controllers/teaching_assistants_controller.rb b/app/controllers/teaching_assistants_controller.rb index e0f9ddc..d9439eb 100644 --- a/app/controllers/teaching_assistants_controller.rb +++ b/app/controllers/teaching_assistants_controller.rb @@ -10,11 +10,13 @@ def create @ta.course_id = 2 when 'CS61C' @ta.course_id = 3 + when 'CS10' + @ta.course_id = 4 else # potential other classes end if @ta.save - redirect_to root_path, flash: { success: "You will receive an email when you are accepted as a Teaching Assistant" } + redirect_to root_path, flash: { success: "You will receive an email when you are accepted as a Teaching Assistant" } else redirect_to root_path, flash: { error: @ta.errors.messages.to_s } end diff --git a/app/views/admins/dashboard/show.html.erb b/app/views/admins/dashboard/show.html.erb index 31b42c8..1ad4e89 100644 --- a/app/views/admins/dashboard/show.html.erb +++ b/app/views/admins/dashboard/show.html.erb @@ -124,7 +124,7 @@