I get the following error when I try to login into my admin back end:

NoMethodError in MemberController#index

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.login

RAILS_ROOT: C:/Ruby/MyProjects/ipod-give-away.com
Application Trace | Framework Trace | Full Trace

app/controllers/member_controller.rb:17:in `index'

Request

Parameters:

None

Show session dump

Response

Headers:

{"cookie"=>[],
 "Content-Type"=>"",
 "Cache-Control"=>"no-cache"}

My code:
def index
    @oLogin = User.find_by_login(params[:l])
    if @oLogin.login
      @sLoggedInName = @oLogin.login + ", you've logged in successfully"
    else
      render :controller => 'sessions'
    end
  end
-- 
Posted via http://www.ruby-forum.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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to