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 @@ <%= f.submit :class => "btn btn-primary" %> - <%= f.select :course_id, options_for_select(%w[CS61A CS61B CS61C]), {}, { :class => "form-control" } %> + <%= f.select :course_id, options_for_select(%w[CS10 CS61A CS61B CS61C]), {}, { :class => "form-control" } %> <%= f.select :day, ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], {}, { :class => "form-control" }%> <%= f.time_select :open, {:ampm => true, :minute_step => 30}, { :class => "form-control form-time" } %> <%= f.time_select :close, {:ampm => true, :minute_step => 30}, { :class => "form-control form-time" } %> diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 38fd087..5a25ade 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -68,7 +68,7 @@ First name: <%= f.text_field :first_name, required: "" %>
Last name : <%= f.text_field :last_name, required: "" %>
Email : <%= f.email_field :email, required: "" %>
- Class: <%= f.select :course_id, options_for_select(%w[CS61A CS61B CS61C]) %>
+ Class: <%= f.select :course_id, options_for_select(%w[CS10 CS61A CS61B CS61C]) %>
<%= f.submit %> <% end %> @@ -81,7 +81,7 @@ Last name : <%= f.text_field :last_name, required: "" %>
Email : <%= f.email_field :email, required: "" %>
SID : <%= f.text_field :SID, required: "" %>
- Class: <%= f.select :course_id, options_for_select(%w[CS61A CS61B CS61C]) %>
+ Class: <%= f.select :course_id, options_for_select(%w[CS10 CS61A CS61B CS61C]) %>
<%= f.submit %> <% end %>