title: ActionView::MissingTemplate error when using modules
body: <p>I'm using a versioned API design from <a href="http://railscasts.com/episodes/350-rest-api-versioning" rel="nofollow">this RailsCasts episode</a> and it's working great, except my jbuilder templates aren't rendering.</p>
  
  <p>Here's my controller code:</p>
  
  <pre><code>module Api
    module V1
      class LocationsController &lt; ApplicationController
        respond_to :json
  
        def index
          @locations = Location.all
        end
      end
    end
  end
  </code></pre>
  
  <p>And my jbuilder file is at <code>app/views/api/v1/locations/index.json.jbuilder</code></p>
  
  <p>I get the following error:</p>
  
  <pre><code>ActionView::MissingTemplate (Missing template api/v1/locations/index, 
  api/v1/api/index, application/index with {:locale=&gt;[:en], :formats=&gt;[:json], 
  :variants=&gt;[], :handlers=&gt;[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. 
  Searched in: * "/XXX/XXX/XXX/XXX/app/views"
  </code></pre>
  
  <p><strong>EDIT:</strong> And here's the code in my <code>routes.rb</code> file:</p>
  
  <pre><code>namespace :api, defaults: { format: :json } do
    namespace :v1 do
      resources :locations,   only: [ :index ]
    end
  end
  </code></pre>
  
  <p>Any ideas how I could debug this? Why are the files in the <code>api</code> folder not being found by Rails? Thanks!</p>