title: Best approach for rails app/api
body: <p>I'm developing a rails app, it's a regular site, but I need to develop an API, so I was reading and trying some stuff, the options that I've thought are (others are welcome): </p>
  
  <ul>
  <li><p>Versioning the API and separate the API from the controller.
  Pro: Clean and separate stuff. Cons: the need to handle 2 controllers for the same task.</p></li>
  <li><p>Not versioning and keep everything in the same controllers, views can be done with jbuilder. Pro: not really easy way to version it. Cons: harder to expose only parts of the app. harder to route stuff like in an versioned way.</p></li>
  </ul>
  
  <p>I really want to avoid duplication, but I need some way to avoid that, and make some nice routes like in a versioned way, I don't want to have more than 1 controller for some type of object, in a versioned way if you have 3 versions you'll end up with 4 controllers, that is a lot to maintain.</p>
  
  <p>Please correct me if I'm wrong, and hope to get some good answers :)</p>
  
  <p>Thanks.</p>