title: NameError in ProjectsController#index
body: <p>In my rails app I am getting the following error:</p>
  
  <pre><code>NameError in ProjectsController#index
  app/controllers/projects_controller.rb:6:in `index'
  </code></pre>
  
  <p>My routes look like this: </p>
  
  <pre><code>RailsStarter::Application.routes.draw do
  resources :projects
  
  root :to =&gt; 'pages#home'
  match '/' =&gt; 'pages#home'
  match '/overview' =&gt; 'pages#overview'
  match '/recruitmentInfo' =&gt; 'pages#recruitmentInfo'
  </code></pre>
  
  <p>And the problem controller:</p>
  
  <pre><code> class ProjectsController &lt; ApplicationController
  
   # GET /projects
   # GET /projects.json
   def index
   @projects = ::Project.all
  
   respond_to do |format|
     format.html # index.html.erb
     format.json { render json: @projects }
   end
  end
  </code></pre>
  
  <p>My investigations so far showed that <code>Project</code> is not yet initialized, but this shouldn't matter as it is a constructor, in its own class. I even tryed precompiling that by adding this line <code>config.autoload_paths += %W( #{config.root}/app/controllers)</code> to <code>application.rb</code>. Nothing seems yet to work. Any ideas will be greatly appreciated. Thanks!</p>