title: Display Different Text When Logged In in Rails
body: <p>I have been following the Railscast #270 found <a href="http://railscasts.com/episodes/270-authentication-in-rails-3-1" rel="nofollow">Rails Cast #270</a> about implementing Authentication in Rails 3.1. What I would like to do is have the ability in my templates to have different links displayed if a user is logged in. It should look something like this.</p>
  
  <pre><code>If user logged in
    Display link to Profile
    Display logout
  If user logged out
   Display link to register
   Display link to login
  </code></pre>
  
  <p>I think I can figure out the link to various places from theRailsTutorial, but I'm stuck on how to tell if a user is signed in or not. </p>
  
  <p>Using the rails tutorial I found this snippet</p>
  
  <pre><code> &lt;% if signed_in? %&gt;
       &lt;li&gt;&lt;%= link_to "Profile", current_user %&gt; sfsdfsdf&lt;/li&gt;
   &lt;% end %&gt;
  </code></pre>
  
  <p>Which doesn't work when I put the following in my sessions helper:</p>
  
  <pre><code>    def signed_in?
        !@current_user.nil?  
  end
  </code></pre>
  
  <p>How would you make this work?</p>