launchscout / nku

NKU Class Spring
5 stars 14 forks source link

NoMethodError in SessionsController#create undefined method `find_by_email' #48

Closed hurtta1 closed 10 years ago

hurtta1 commented 10 years ago

Now i'm stuck on this. def create student = Student.find_by_email(params[:email]) if student && student.authenticate(params[:password]) session[:student_id] = student.id redirect_to show_student_path, :notice => "Welcome to your profile"

jaimerump commented 10 years ago

I noticed that in your database migrations you have name, nickname, email, and gravatar all starting with capital letters, perhaps that's the issue. I have mine named identically, except all lowercase, and find_by_email works fine for me.

hurtta1 commented 10 years ago

I thought I tried that already,I'll give it another shot.

hurtta1 commented 10 years ago

Guess I missed changing something, that ended up solving that problem, thanks!