title: Rails root resource JSON
body: <p>I'm having a bit of a problem. I want <code>posts</code> to be the default resource when navigating to my site (it's a blog:)</p>
  
  <p><code>www.example.com/ #=&gt; posts#index</code></p>
  
  <p><code>www.example.com/15 #=&gt; posts#show</code></p>
  
  <p>etc. However, I want to be able to open up an API that I can use on my portfolio. I can use the <code>respond_to format.json</code> block to allow this:</p>
  
  <p><code>www.example.com/15.json</code></p>
  
  <p>but I can't figure out how to output the index action as json. Here are my current routes:</p>
  
  <pre><code>resources :posts, :path =&gt; ''
  </code></pre>
  
  <p>How would I access the index action with a JSON extension? Sorry If that didn't make any sense.</p>