Hi I have problem trying to pass the signin failure test.
This is the test code of the sessions_controller.rb
def create user = User.authenticate(params[:session][:email], params[:session][:password]) if user.nil? flash.now[:error] = "Invalid email/password combination." @title = "Sign in" render 'new' else # Sign the user in and redirect to the user's show page. end end
If I check in my browser and clic on submit with all fields empty, I
get the following error:
NoMethodError in SessionsController
#create undefined method `nil’ for nil:NilClass
I check the book many times and I have code exactly as the book, but I
still have the error. Any help???
You can check the code in this link listing 9.8
What I doing wrong?
Thanks for any help.