title: having users index for admin and normal users
body: <p>I want to have the users index page to list the admin and normal users separately, the below where you can select the Student or Admin view, via what I'd presume would be links...</p>
  
  <p>Index view for users...</p>
  
  <pre><code>&lt;h1&gt;Listing users&lt;/h1&gt;
  
  &lt;p&gt;&lt;b&gt;&lt;u&gt;Students&lt;/u&gt;&lt;/b&gt; &lt;u&gt;Admins&lt;/u&gt;&lt;/p&gt;
  
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Email&lt;/th&gt;
      &lt;th&gt;Login count&lt;/th&gt;
    &lt;/tr&gt;
  
  &lt;% @users.each do |user| %&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;%= user.email %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= user.login_count %&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;% end %&gt;
  &lt;/table&gt;
  
  &lt;p&gt;&lt;%= link_to 'New User', new_admin_user_path %&gt;&lt;/p&gt;
  </code></pre>
  
  <p>In my Users controller</p>
  
  <pre><code>class Admin::UsersController &lt; ApplicationController
      before_filter :require_admin_user
  
      def index
        # @users = User.admin 
        @users = User.students.paginate page: params[:page], order: 'created_at desc', per_page: 20
  
        respond_to do |format|
          format.html # index.html.erb
          format.json { render :json =&gt; @users }
        end
      end
  </code></pre>
  
  <p>Is this possible?</p>