rails routing not going to controller as expected <p>I would like to get reviews for a specific user. I'm trying to hit </p> <pre><code>var reviews_url = '/users/' + profile_id + '/reviews.json'; </code></pre> <p>but it's not hitting <code>reviews#index</code> as seen in the logs</p> <pre><code>Started GET "/users/23/reviews.json" for ::1 at 2015-05-03 10:50:01 -0700 Processing by ApplicationController#index as JSON </code></pre> <p>What can I change to make this route hit <code>reviews#index</code>?</p> <p><code>routes.rb</code></p> <pre><code>resources :users do resources :reviews end </code></pre> <p><code>rake routes</code></p> <pre><code>GET /users/:user_id/reviews(.:format) reviews#index </code></pre> <p>EDIT TO ADD ROUTES</p> <pre><code>get 'auth/:provider/callback', to: 'sessions#create' root 'application#index' get '*path' =&gt; 'application#index' resources :users do resources :reviews resources :friendships end </code></pre> <p>Note: when I move <code>resources</code> above <code>get '*path' =&gt; 'application#index'</code> it works as expected. However I would like to have each call go through <code>application#index</code> (the app is a SPA that knows the current user based on the user in <code>application#index</code>). Maybe I should namespace these routes into <code>api</code>? </p>