hotsh/rstat.us — pull request #625 by carols10cents (2012-09-05 02:31:02+00:00)
Title: In respond_to blocks, prefer HTML over JSON if the request does not spec...

...ify what it prefers

I was testing out some things using open-uri on user show (ie: https://rstat.us/users/Carols10cents) where I was getting JSON back but I expected HTML since I didn't specify .json in the URL.

I was seeing the same behavior using curl, and curl showed me that the Accept header was `*/*`.

Turns out [order matters](http://apidock.com/rails/ActionController/MimeResponds/InstanceMethods/respond_to#500-Ordering-of-format-blocks-is-important) in the respond_to block, and we should be preferring HTML over JSON. I found 2 places where this was the case.