title: Rails changing database connection inside a controller
body: <p>I created a REST API with rails 3.</p>
  
  <p>I use namespace to create virtual environnement development and production, myapi.net/dev/function redirect to a controller in dev directory.</p>
  
  <p>Everything works fine except that my app is now in production and I would like to use the development database when the url called contain /dev/</p>
  
  <p>I know I can change the database in my model, but the model is the same in dev and prod.</p>
  
  <p>Is there a way to do this ?</p>
  
  <p>I know this is not really best practices when using an MVC but I need to do this before creating a real environnement.</p>
  
  <p>Thanks for your help !</p>