title: Circular dependency detected while autoloading constant Api::V1::TodosController
body: <p>I'm following the tutorial here: <a href="https://egghead.io/lessons/angularjs-rails-todo-api-part-1" rel="nofollow">https://egghead.io/lessons/angularjs-rails-todo-api-part-1</a> but I end up getting that error when I hit this on my localhost: /api/v1/todos</p>
  
  <p><strong>routes.rb:</strong></p>
  
  <pre><code>  namespace :api, defaults: {format: :json} do 
      namespace :v1 do 
        resources :todos 
      end
    end
  </code></pre>
  
  <p><strong>controllers/api/v1/todos_controller.rb</strong></p>
  
  <pre><code>module Api
      module V1
          class TodosController &lt; ApplicationController
              skip_before_filter :verify_authenticity_token 
              respond_to :json 
  
              def index 
                  respond_with(Todo.all.order("completed ASC").order("id DESC"))
              end 
  
              def show 
                  @todo = Todo.find(params[:id])
                  respond_with(@todo)
              end 
  
              def create 
                  @todo = Todo.new(todo_params)
                  if @todo.save respond_to do |format| 
                      format.json { render :json =&gt; @todo } 
                  end 
              end 
  
              def update
                  @todo = Todo.find(params[:id])
                  if @todo.update(todo_params) 
                      respond_to do |format| 
                          format.json { render :json =&gt; @todo } 
                      end
                  end
              end
  
              def destroy
                  respond_with Todo.destroy(params[:id])
              end
  
              private 
                  def todo_params
                    params.require(:todo).permit(:title, :completed)
                  end
          end
      end
  end
  </code></pre>