title: Rails routing resource in namespace starting with a parameter
body: <p>I have 2 namespaces, api and v1
  I have accounts and users as resources.</p>
  
  <p>I want to map the routing as follows for all my resources:</p>
  
  <p>/api/v1/:account_id/:resource/:id</p>
  
  <p>i.e:
  /api/v1/1/users/2</p>
  
  <p>In the example 1 stands for account id and 2 stands for user id.</p>
  
  <p>How do I accomplish this?</p>