You are returning just the email, not the entire user.  The method is more useful if you return the full user. Also, if there is not a session[:user_id] this will crash so protect your code with an if session[:user_id]