How to have "current_user" (coded as `session[:user_id]`) show user email, instead of some weird code?
<p>I followed a tutorial on Rails forms (login,logout). All went well except for this bit: Once a user has logged in, the bottom of the page should say "You are logged in as" followed by an email address, so it will say, for example, "You are logged in as Jane@aol.com". The line of code responsbile for this:</p>

<p><code>&lt;p&gt;You are logged in as: &lt;%= @current_user %&gt;&lt;/p&gt;</code></p>

<p>However, what I get instead is <code>You are logged in as: #&lt;User:000s500r00k000h0&gt;</code> (Not an exact copy)</p>

<p>For the life of me, I cannot figure out what that number is and why the user's email doesn't show up-nor where to begin troubleshooting:</p>

<p><code>current_user</code> is defined in ApplicationController:</p>

<p><code>class ApplicationController &lt; ActionController::Base
  protect_from_forgery with: :exception</code></p>

<p><code>def authentication_required
    if !logged_in?
      redirect_to login_path
    end
  end</code></p>

<p><code>def logged_in?
    !!current_user
  end</code></p>

<p><code>def current_user
    @current_user ||= begin
      User.find(session[:user_id]) if session[:user_id]
    end
  end
  helper_method :current_user
end</code></p>

<p>The <code>user_id</code> ought to be the user's email. What did I miss?</p>