app/controllers/teachers/omniauth_callbacks_controller.rb
# You should also create an action method in this controller like this:
You should also create an action method in this controller like this.
You should also create an action method in this controller like this .
def github
    if session[:type] == 'teacher'
      @user = Teacher.from_omniauth(request.env["omniauth.auth"])
      complete_github(@user, :teacher, new_teacher_registration_path)
    elsif session[:type] == 'student'
      @user = Student.from_omniauth(request.env["omniauth.auth"])
      complete_github(@user, :student, new_teacher_registration_path)
    end
  end
def github if session [ :type ] == 'teacher' @user = Teacher . from_omniauth ( request . env [ "omniauth.auth" ] ) complete_github ( @user , :teacher , new_teacher_registration_path ) elsif session [ :type ] == 'student' @user = Student . from_omniauth ( request . env [ "omniauth.auth" ] ) complete_github ( @user , :student , new_teacher_registration_path ) end end
You should also create an action method in this controller like this:
You should also create an action method in this controller like this :
#You need to implement the method below in your model (e.g. app/models/user.rb)