# Respond\_to issue in IE7

**URL:** <https://www.ruby-forum.com/t/respond-to-issue-in-ie7/170604>\
**Category:** Rails\
**Created:** [June 19, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/respond-to-issue-in-ie7/170604 "2009-06-19T16:20:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shanmu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@shanmu](https://www.ruby-forum.com/u/shanmu)\
**Post date:** [June 19, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/respond-to-issue-in-ie7/170604/1 "2009-06-19T16:20:20Z")

</div>

Hi all,

can somebody help me with this issue in respond\_to?

def new  
respond\_to do |format|  
format.xml { puts ‘xml’}  
format.html { puts ‘html’}  
format.pdf { puts ‘pdf’}  
format.js { puts ‘js’}  
end  
end

When i run this code in FireFox i am getting “html” for puts, but if i  
run the same code in IE7 then i am getting “xml” as puts. If i change  
the above code as

def new  
respond\_to do |format|  
format.pdf { puts ‘pdf’}  
format.html { puts ‘html’}  
format.xml { puts ‘xml’}  
format.js { puts ‘js’}  
end  
end

and when i run it in FireFox i am getting the same “html” as puts but in  
IE7 i am getting “pdf” as puts.

The expected o/p in both the browser is “html”. In FireFox i am getting  
the right o/p but not in IE7. IE7 is printing the one which is given in  
the first line. How to over come this?

Thanks,  
shanmu

---

<div class="post-metadata">

**Author:** ![shanmu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@shanmu](https://www.ruby-forum.com/u/shanmu)\
**Post date:** [June 20, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/respond-to-issue-in-ie7/170604/2 "2009-06-20T18:03:52Z")

</div>

This is a known issue with IE sending an incorrect Accepts: header.  
See also this:

[http://www.danielcadenas.com/2008/10/internet-explorer-7-accept-header-and.html](http://www.danielcadenas.com/2008/10/internet-explorer-7-accept-header-and.html)

–Matt J.

On Jun 19, 10:20 am, Shanmu G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![shanmu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@shanmu](https://www.ruby-forum.com/u/shanmu)\
**Post date:** [June 22, 2009, 6:33am UTC](https://www.ruby-forum.com/t/respond-to-issue-in-ie7/170604/3 "2009-06-22T06:33:30Z")

</div>

Matt J. wrote:

> This is a known issue with IE sending an incorrect Accepts: header.  
> See also this:
> 
> [http://www.danielcadenas.com/2008/10/internet-explorer-7-accept-header-and.html](http://www.danielcadenas.com/2008/10/internet-explorer-7-accept-header-and.html)
> 
> –Matt J.
> 
> On Jun 19, 10:20ï¿½am, Shanmu G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Thanks Jones,
