diff --git a/app/controllers/student_courses_controller.rb b/app/controllers/student_courses_controller.rb index 839f6e8..162e7ca 100644 --- a/app/controllers/student_courses_controller.rb +++ b/app/controllers/student_courses_controller.rb @@ -12,28 +12,24 @@ def index # GET /student_courses/1.json def show end -<<<<<<< HEAD - end - - # DELETE /student_courses/1 - # DELETE /student_courses/1.json - def destroy - @student_course.destroy - respond_to do |format| - if current_user.utype =="student" - flash[:success] = "Student was succesfully removed from the course" - format.html { redirect_to course_history_display_url } - flash[:success] = "Student was succesfully removed from the course" - else - format.html { redirect_to course_history_display_url } - end - -======= + + # DELETE /student_courses/1 + # DELETE /student_courses/1.json + def destroy + @student_course.destroy + respond_to do |format| + if current_user.utype =="student" + flash[:success] = "Student was succesfully removed from the course" + format.html { redirect_to course_history_display_url } + else + format.html { redirect_to course_history_display_url } + end + end + end # GET /student_courses/new def new @student_course = StudentCourse.new ->>>>>>> c6f9a7ce075f9d3fbba676726e805b8e35a5df88 end # GET /student_courses/1/edit @@ -73,15 +69,15 @@ def update end # DELETE /student_courses/1 - # DELETE /student_courses/1.json - def destroy - @student_course.destroy - respond_to do |format| - flash[:success] = "Student was succesfully removed from the course" - format.html { redirect_to course_history_display_url} - flash[:success] = "Student was succesfully removed from the course" - end - end + # # DELETE /student_courses/1.json + # def destroy + # @student_course.destroy + # respond_to do |format| + # flash[:success] = "Student was succesfully removed from the course" + # format.html { redirect_to course_history_display_url} + # flash[:success] = "Student was succesfully removed from the course" + # end + # end def enrolledshow @student_courses = StudentCourse.all.map{|course| course if ((course.course_id == params[:id].to_i) && (course.status=="enrolled"))}