[Rails] ruby on rails 3 tutorial book chapter9 Signin Failure
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
http://ruby.railstutorial.org/chapters/sign-in-sign-out#sec:signin_failure
What I doing wrong?
Thanks for any help.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home