I have an app with a link to a controller like /something/orders.xml
which uses RABL to construct an XML doc. Works, but it seems due to the browser's request header this is being returned as text/html in some browsers, for instance, Chrome:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
I want the response to have Content-type: text/xml
because that's what it is! So, according to many howtos and the Rails Guides, you can do
config.action_controller.use_accept_header = false
in application.rb
. But this is currently resulting in undefined method use_accept_header=
:
/home/sbeam/.rvm/gems/ruby-1.9.3-p194@global/gems/actionpack-3.2.6/lib/action_controller/railtie.rb:41:in `block (3 levels) in <class:Railtie>': undefined method `use_accept_header=' for ActionController::Base:Class (NoMethodError)