title: Using cancan to prevent access to controller
body: <p>I have an admin controller and I want that only users that are defined as admin would have access to that controller.</p>
  
  <p>my ability class:</p>
  
  <pre><code>class Ability
    include CanCan::Ability
  
    def initialize(user)
      if user.admin?
        can :manage, :all
      else
        can :read, :all
      end
    end
  end
  </code></pre>
  
  <p>my admin controller:</p>
  
  <pre><code>class AdminController &lt; ApplicationController
    load_and_authorize_resource
  
    def index
    end
  
    def users_list
    end
  end
  </code></pre>
  
  <p>when i try to access <code>/admin/users_list</code> (either with an admin user or without) i get the following error: <code>uninitialized constant Admin</code></p>
  
  <p>What am I doing wrong? Is that the right way to restrict access to a controller? </p>