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
return user if user.has_password?(summitted_password)
end
I don't understand what's happen
On Feb 3, 11:56 am, Dave Aronson <googlegroups2d...@davearonson.com>
wrote:
> On Fri, Feb 3, 2012 at 11:53, Jean <josor...@gmail.com> wrote:
> > if I fill the field with and user and password,
> > that exist in my db I get the same error.
>
> That also sounds like a forgotten question mark. Ruby would try to
> call it, and fail, either way.
>
> -Dave
>
> --
> Dave Aronson: Available Cleared Ruby on Rails Freelancer
> (NoVa/DC/Remote) -- seewww.DaveAronson.com, and blogs atwww.Codosaur.us,www.Dare2XL.com,www.RecruitingRants.com
--
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.
hey everyone i have installed rails3.0.0 in windows and my previous
rails projects not working . so i wanna uninstall rails and then
install from Scratch.
thanks in advance
--
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.
On Fri, Feb 3, 2012 at 11:53, Jean <josorioe@gmail.com> wrote:
> if I fill the field with and user and password,
> that exist in my db I get the same error.
That also sounds like a forgotten question mark. Ruby would try to
call it, and fail, either way.
-Dave
--
Dave Aronson: Available Cleared Ruby on Rails Freelancer
(NoVa/DC/Remote) -- see www.DaveAronson.com, and blogs at
www.Codosaur.us, www.Dare2XL.com, www.RecruitingRants.com
--
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.