title: Rails: Restrict access to specific pages
body: <p>I followed <a href="http://railscasts.com/episodes/250-authentication-from-scratch" rel="nofollow noreferrer">this</a> tutorial, and it works. But how can I restrict a page so that only users that are logged in can access it? </p>
  
  <p>I wrote <code>&lt;% if current_user %&gt;</code> at the top of one page and if I tried to access it when I wasn't logged in, I could not access it (so this is one solution). But, is there a way I can do this in the controller? (I tried to use a before_filter as described in <a href="https://stackoverflow.com/questions/8500350/how-to-allow-access-only-to-logged-in-users-restricting-direct-entry-of-url">this</a> post, but it did not work).</p>