title: Rails : add namespace to resource
body: <p>I currently have this in my <code>routes.rb</code> :</p>
  
  <pre><code>namespace :api
    namespace :v1
     namespace :me
      # ...
      resources :offers do
       resources :state, only: %i(index)
      end
    end
   end
  end
  </code></pre>
  
  <p>This gives me this route : </p>
  
  <pre><code>GET v1/me/offers/:offer_id/state(.:format)
  api/v1/me/state#index
  </code></pre>
  
  <p>But the route I would like to have is this one :</p>
  
  <pre><code>GET v1/me/offers/:offer_id/state(.:format)
  api/v1/me/offers/state#index
  </code></pre>
  
  <p>Simply put, I want to be able to place my <code>state_controller.rb</code> in an <code>offers</code> folder, without changing the path to access it.
  How can I achieve that ?</p>