views:

37

answers:

1

I have a standard contacts_controller.rb with index action that responds as follows:

respond_to do |format|
  format.html
  format.xml  { render :xml => @contacts }
end

In development, it works as intended: when I browse to http://localhost:3000/contacts, I get an html response.

But, when I start the app using capistrano on a remote Ubuntu server and browse to the same url, I get an xml response.

If I go to http://remote_host:8000/contacts.html, then I see the html response. If I comment out the format.xml { render :xml => @contacts }, then I see the desired html response.

Pretty sure I'm missing something subtle about difference between Rails development and production modes. Any ideas about what I'm overlooking?

Thanks, - Dave

A: 

The following links explain the phenomenon:

http://rails_security.lighthouseapp.com/projects/15332/tickets/5-using-http-basic-authentication-with-ie-not-working

http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/

I fixed my issue by adding this to development|test|production.rb:

config.action_controller.use_accept_header = false
Dave Paroulek