title: localhost redirected you too many times ruby on rails
body: <p>I'm using devise/Ruby on Rails and when I try to open my localhost I get the following infinite loop, and have no idea why since the only change I've made was creating seeds using the Faker gem, and creating a show view for when the user logs in.</p>
  
  <p>At first I thought it was something wrong with my if/else statement in my controller, since when I reseed the data, there's no current_user signed in and it should take me to the new user registration path created through devise, but was lost as to why it repeats itself..</p>
  
  <p>Any and all help would be greatly appreciated!</p>
  
  <p>Below is terminal:</p>
  
  <pre><code>Started GET "/users/sign_in" for 127.0.0.1 at 2017-12-30 13:53:58 -0800
  Processing by UsersController#show as HTML
    Parameters: {"id"=&gt;"sign_in"}
  Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms)
  </code></pre>
  
  <p>UsersController</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
  before_action :authenticate_user!
  
    def show
      if current_user.present?
        @user = current_user
        @item = Item.new
        @items = @user.items
      else
        redirect_to new_user_registration_path
      end  
    end
  end
  </code></pre>
  
  <p>Users#show</p>
  
  <pre><code>&lt;h2&gt; Your to-do list&lt;/h2&gt;
  
  
    &lt;div class="col-md-8"&gt;
      &lt;div class='items'&gt;
        &lt;%= render partial: "items/item", local: { item: @item} %&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="col-md-8"&gt;
      &lt;div class='new-item'&gt;
        &lt;%= render partial: "items/form", local: { item: @item } %&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Routes:</p>
  
  <pre><code>Rails.application.routes.draw do
    get 'welcome/index'
  
    get 'welcome/about'
  
    root 'users#show'
  
    resources :users do
      resources :items, only: [:new, :create, :index]
    end
  
  
    devise_for :users
    # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
  end
  </code></pre>