rails/rails — pull request #7464 by LTe (2012-08-28 10:20:57+00:00)
Title: Proper mime negotiation in case of non-ajax request

Currently when client send request to rails with proper `Accept` header rails will return always HTML. When I need `JSON` or other format I can of course add `.(:format)` and rails will recognize this. Why is this the only option?

* I do not want nor need to use :format in routes
* I use jQuery.getJSON method with cross-domain option `HTTP_X_REQUESTED_WITH` is not set
* There is a proper Accept header : `application/json, text/javascript, */*; q=0.0`
* There is respond_to :json in controller definition
* I use respond_with in action and give it an object that has to_json and as_json method implemented

When I ask for `JSON` rails should respond with JSON.