# Respond\_to for unknown type

**URL:** <https://www.ruby-forum.com/t/respond-to-for-unknown-type/108840>\
**Category:** Rails\
**Created:** [July 8, 2007, 12:36am UTC](https://www.ruby-forum.com/t/respond-to-for-unknown-type/108840 "2007-07-08T00:36:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kristoph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7cd45c/32.png) [@Kristoph](https://www.ruby-forum.com/u/Kristoph)\
**Post date:** [July 8, 2007, 12:36am UTC](https://www.ruby-forum.com/t/respond-to-for-unknown-type/108840/1 "2007-07-08T00:36:41Z")

</div>

Greetings,

How would I go about handling an unknown type in a respond\_to block?

That is, I currently have …

respond\_to do | format |  
format.html { do something }  
format.xml { do something else }  
end

I would like a handler for all other format’s, other than html/xml, so  
that I can, for example, log the request, render an error or whatnot.

Thank you,

]{
