On 3 February 2012 17:13, Jean wrote:
No Dave, I copy from my code.  And this is the error:

NoMethodError in SessionsController#create

undefined method `nil' for nil:NilClass
Rails.root: /Users/jeanosorio/rails_projects/sample_app

Application Trace | Framework Trace | Full Trace
app/models/user.rb:37:in `authenticate'
app/controllers/sessions_controller.rb:7:in `create'
Request

Parameters:

{"utf8"=>"✓",
"authenticity_token"=>"1Dc0iARaC7tLF0Jwp7ZX9XJAOTtqHqavl0+x6qkHlEw=",
"session"=>{"email"=>"",
"password"=>"[FILTERED]"},
"commit"=>"Sign in"}


And this is the code for user model

def self.authenticate(email, submitted_password)
user = find_by_email(email)
return nil if user.nil
Read the earlier posts from Dave carefully and look at the line above.

Colin

--
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.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 11 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 3, '12 at 4:37p
activeFeb 3, '12 at 8:30p
posts11
users5
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase