In my controller, I support HTML and JSON in my index method by doing:
respond_to do |format| format.html format.json { render json: @user } end
When pulling it in a browser, it visually displays the HTML. However, when I make a curl call with the application/json content type in the /user resource (since this is an index method), I still get HTML as an answer.
How can I get JSON as an answer? What else do I need to specify?
source share