rails contoller defaults to respond with application/xml in production

Posted by Dave Paroulek on Stack Overflow See other posts from Stack Overflow or by Dave Paroulek
Published on 2010-05-23T13:30:16Z Indexed on 2010/05/23 13:30 UTC
Read the original article Hit count: 236

Filed under:

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 a 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

© Stack Overflow or respective owner

Related posts about ruby-on-rails