hi, this is part of the standard UserSession Code:
def create
@user_session = UserSession.new(params[:user_session])
@user_session.save do |result|
if result
flash[:notice] = "Successfully logged in."
p "----------A-------------------"
p @user_session.inspect
p "-----------B------------------"
p current_user.inspect
........
LOG
A: "#<UserSession: {:login=>\"tom\",
:password=>\"<protected>\"}>"
B: "nil"
but, i do have this in the app-controller:
def current_user_session
return @current_user_session if defined?(@current_user_session)
@current_user_session = UserSession.find
end
def current_user
return @current_user if defined?(@current_user)
@current_user = current_user_session &&
current_user_session.record
end
so , why cant i access current_user- record (in A)?
thx
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.