title: How to require authentication for all pages with Devise?
body: <p>I have started to use Devise gem and now trying to implement the code, so my web app will require to login for each and every page on my app. I have added the following code to <strong>routes.rb</strong> according to <a href="https://github.com/plataformatec/devise/wiki/How-To:-Require-authentication-for-all-pages" rel="noreferrer">this instruction</a>:</p>
  
  <pre><code>authenticated :user do
    root to: 'home#index', as: :authenticated_root
  end
  root to: redirect('/users/sign_in')
  </code></pre>
  
  <p>but it doesn't work. When I go to any page - it just open that page, and doesn't forward me to the sign_in page. Could anyone please clarify what I missed? Any help would be appreciated.</p>