title: Rails HTML Request Render JSON
body: <p>In my controller, I'm supporting HTML and JSON in my <code>index</code> method by doing: </p>
  
  <pre><code>respond_to do |format|
    format.html
    format.json { render json: @user }
  end
  </code></pre>
  
  <p>When pulling it up in the browser, it renders in HTML naturally. However, when I do a curl call with content-type being <code>application/json</code> to the <code>/user</code> resource (since it's the index method), I still get the HTML as a response.</p>
  
  <p>How can I get the JSON as a response? What else do I need to specify?</p>