title: Rails 4 Index only shows 1 user
body: <p>I am currently using devise + omniauth authentication to signup users. But when I click on index link, it only shows 1 user. I currently have about 5 demo users signed up. Does anyone know how to show the other 4 users and more that will sign up?</p>
  
  <p>These are my user and controller code lines</p>
  
  <pre><code>Application_contoller.rb
  
  class ApplicationController &lt; ActionController::Base
    # Prevent CSRF attacks by raising an exception.
    # For APIs, you may want to use :null_session instead.
    protect_from_forgery with: :exception
  
    before_filter :configure_permitted_parameters, if: :devise_controller?
  
    protected
  
      def configure_permitted_parameters
        devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :email, :password, :last_name, :first_name) }
        devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:first_name, :last_name,:profile_name,:email, :password, :name) }
        devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:name, :email, :password, :last_name, :first_name) }
        devise_parameter_sanitizer.for(:account_update) { |u| 
        u.permit(:password, :password_confirmation, :current_password, :name) 
      }
      end
  
  end
  </code></pre>
  
  <p>user.rb</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :authentications
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable, :omniauthable,
           :recoverable, :rememberable, :trackable, :validatable,
           :omniauth_providers =&gt; [:facebook]
  
    attr_accessible :email, :password, :password_confirmation, :name
  
    def self.from_omniauth(auth)
      where(provider: auth.provider, uid: auth.uid).first_or_initialize.tap do |user|
        user.provider = auth.provider
        user.uid = auth.uid
        user.name = auth.info.name
        user.email = auth.info.email
        user.oauth_token = auth.credentials.token
        user.oauth_expires_at = Time.at(auth.credentials.expires_at)
        user.save!
      end
    end
  
    def self.new_with_session(params, session)
      if session["devise.user_attributes"]
        new(session["devise.user_attributes"], without_protection: true ) do |user|
          user.attributes = params
          user.valid?
        end
      else
        super
      end
    end
  
    def password_required?
      super &amp;&amp; provider.blank?
    end
  
    def email_required?
      super &amp;&amp; provider.blank?
    end
  end
  </code></pre>
  
  <p>users_controller.rb</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
    def show
      @user = User.find(params[:id])
    end
  
    def index
      @users = User.paginate(page: params[:page])
    end
  
    def edit
      @user = User.find(params[:id])
    end
  
    def update
      @user = User.find(params[:id])
      if @user.update_attributes(user_params)
        flash[:success] = "Profile updated"
        redirect_to @user
      else
        render 'edit'
      end
    end
  
    private
  
      def user_params
        params.require(:user).permit(:name, :email, :password,
                                     :password_confirmation)
      end
  end
  </code></pre>
  
  <p>app/views/user/index.html.erb</p>
  
  <pre><code>&lt;% provide(:title, 'All users') %&gt;
  &lt;h1&gt;All users&lt;/h1&gt;
  
  &lt;%= will_paginate %&gt;
  
  &lt;ul class="users"&gt;
    &lt;%= render @users %&gt;
  &lt;/ul&gt;
  
  &lt;%= will_paginate %&gt;
  </code></pre>
  
  <p>app/views/user/_user.html.erb</p>
  
  <pre><code>&lt;li&gt;
      &lt;%= gravatar_for user, size: 50 %&gt;
      &lt;%= link_to user.name, user %&gt;
  
  &lt;/li&gt;
  </code></pre>
  
  <p>Thanks in advance!</p>