# The Content-Type problem

**URL:** <https://www.ruby-forum.com/t/the-content-type-problem/126813>\
**Category:** Rails\
**Created:** [January 22, 2008, 2:24pm UTC](https://www.ruby-forum.com/t/the-content-type-problem/126813 "2008-01-22T14:24:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MohsinHijazee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@MohsinHijazee](https://www.ruby-forum.com/u/MohsinHijazee)\
**Post date:** [January 22, 2008, 2:24pm UTC](https://www.ruby-forum.com/t/the-content-type-problem/126813/1 "2008-01-22T14:24:40Z")

</div>

Hello!  
I have a rails 1.2 application which I recently ported to Rails  
2.02. I added a mapping in the routes.rb file like this:

map.resources :accounts

Next, I implemented the

respond\_to do |format|  
format.html {render :text =\> @account.to\_xml}  
format.xml {render :xml =\> @account.to\_xml}  
format.json {render :json =\> @account.to\_json}  
end

thing. When I browse the following URL,  
localhost:3000/accounts/1.xml

Then the page is rendered in plain text though if we view the source  
of the page, we can see the pure XML generated by our application. But  
why the browser is rendering it as plain text instead of showing it in  
a tree structure as usually Firefox do.

However, if I create a new Rails application from scratch, it behaves  
as expected. What might be wrong?

Please guide me in this regard.

Note: I use Firefox 2.0.0.11

Regards,  
Mohsin
