# Formats available for controller

**URL:** <https://www.ruby-forum.com/t/formats-available-for-controller/121798>\
**Category:** Rails\
**Created:** [December 1, 2007, 12:43am UTC](https://www.ruby-forum.com/t/formats-available-for-controller/121798 "2007-12-01T00:43:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephanie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@stephanie](https://www.ruby-forum.com/u/stephanie)\
**Post date:** [December 1, 2007, 12:43am UTC](https://www.ruby-forum.com/t/formats-available-for-controller/121798/1 "2007-12-01T00:43:45Z")

</div>

Hello,

I was wondering if there is any way to retrieve the list of formats  
defined in the respond\_to block of a controller?

For example if the following is in a controller:

```
respond_to do |format|
  format.html
  format.xml { render :xml => @people.to_xml }
end

```

Is there a way to find out HTML and XML are available? I want to write  
a method that creates an XML list of all formats available for any  
given controller.

Cheers,  
Stephanie
