I want to implement content negotiation on some resources in a Rails application. I use Mootools and probably can configure the content type accepted by XMLHTTPRequest to "application / json".
Is there a way to get this information in my controller and generate JSON responses instead of XHTML?
I try to avoid doing something like:
http:
... since it loads my url, imposes a certain degree of redundancy and is not so flexible.
Thanks!
json rest mootools ruby-on-rails content-negotiation
Alexander Trauzzi
source share