I want to check it the @session[:user].id exists in an if statement. However, I the user has not yet logged in, the following error occurs. How does one check if this (or any other) cookie exists without getting this error? Thanks! Account#manager Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id -- Posted via http://www.ruby-forum.com/.
On Thu, Feb 23, 2006 at 04:41:59PM +0100, cranberry wrote: } I want to check it the @session[:user].id exists in an if statement. } } However, I the user has not yet logged in, the following error occurs. } How does one check if this (or any other) cookie exists without getting } this error? if @session[:user] && @session[:user].id } Thanks! --Greg
Possibly Parallel Threads
- Setting P3P header before Set-Cookie
- Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
- RuntimeError in Recipe#edit
- Called id for nil, which would mistakenly be 4 -- if you really wanted the idof nil, use object_id - solved
- Setting cookie value in test